Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import tensorflow as tf
  2. from tensorflow.python.training import rmsprop,ftrl,gradient_descent
  3.  
  4. x = tf.Variable(5., trainable=True)
  5.  
  6.  
  7. @tf.function
  8. def f_x():
  9. return x*x
  10.  
  11.  
  12. for _ in range(100):
  13. print([x.numpy(), f_x().numpy()])
  14. opt = gradient_descent.GradientDescentOptimizer(0.1).minimize(f_x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement