작성
·
1.8K
0
w=tf.Variable(-1. , dtype=tf.float32)
b=tf.Variable(-1. , dtype=tf.float32)
learning_rate=0.01
for x, y in zip(x_data, y_data):
with tf.GradientTape() as tape:
prediction = w*x+b
loss=(prediction-y)
gradeints=tape.gradient(loss, [w,b])
w=tf.Variable(w-learning_rate*gradients[0])
b=tf.Variable(w-learning_rate*gradients[1])
learning_rate과 gradients[0]이 데이터타입이 달라서
곱셈연산이 안된다고 나오는거 같은데 여기서 어떻게 하면 될까요??..