Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tensorflow as tf
- from tensorflow.python.training import rmsprop,ftrl,gradient_descent
- x = tf.Variable(5., trainable=True)
- @tf.function
- def f_x():
- return x*x
- for _ in range(100):
- print([x.numpy(), f_x().numpy()])
- opt = gradient_descent.GradientDescentOptimizer(0.1).minimize(f_x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement