Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. # Example using tf.control_dependencies:
  2. update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)
  3. with tf.control_dependencies(update_ops):
  4. train_op = optimiser.minimize(loss)
  5.  
  6. # Example using tf.group:
  7. update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS)
  8. minimize = optimizer.minimize(loss)
  9. train_op = tf.group([minimize, update_ops])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement