In the example provided at http://www.tensorflow.org/get_started if I multiply the input by 2
x_data = np.float32(np.random.rand(2, 100))*2
I get non-sense output, while I expected to get the same solution.
0 [[ -67.06586456 -109.13352203]] [-7.67297792]
20 [[ nan nan]] [ nan]
40 [[ nan nan]] [ nan]
60 [[ nan nan]] [ nan]
80 [[ nan nan]] [ nan]
100 [[ nan nan]] [ nan]
120 [[ nan nan]] [ nan]
140 [[ nan nan]] [ nan]
160 [[ nan nan]] [ nan]
180 [[ nan nan]] [ nan]
200 [[ nan nan]] [ nan]
How does tensorflow handle inputs that are not in the 0-1 range?
EDIT: Using AdagradOptimizer
works without an issue.
The issue is that the example uses a very aggressive learning rate:
optimizer = tf.train.GradientDescentOptimizer(0.5)
This makes learning faster, but stops working if you change the problem a bit. A learning rate of 0.01
would be more typical:
optimizer = tf.train.GradientDescentOptimizer(0.01)
Now your modification works fine. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With