Tensorflow On Simple Linear Regression
I am a beginner in machine learning and tensorflow. In the first step trying the tensorflow, I tried a simple multivariate linear regression. However, it seems the model stuck at a
Solution 1:
This is because y
is not the same shape as y_
. y
is of shape (1000, 1) and y_
is of shape (1000). So when you subtract them, you're inadvertently creating a 2-D matrix.
To fix it change your cost function to:
cost_function = tf.reduce_mean(tf.square(tf.squeeze(y) - y_))
Post a Comment for "Tensorflow On Simple Linear Regression"