This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tensorflow as tf | |
# 커스텀 Estimator 모델(func) | |
def model_fn(features, labels, mode): | |
W = tf.get_variable('W', [1], dtype=tf.float64) # tf.get_variable(): Gets an existing variable with parameter or create a new one. | |
b = tf.get_variable('b', [1], dtype=tf.float64) | |
y = W * features['x'] + b | |
# loss(오차) 서브 그래프 |