tf.gradients、tf.compute_gradients和tf.stop_gradient
import tensorflow as tf
w = tf.Variable([2., 5.])
# u = tf.Variable([7., 9.])
y = 2 * w
x = 2 * y
z = 2 * x
stop_y = tf.stop_gradient(y)
stop_x = 2 * stop_y
grad1 = tf.gradients(y, w)
grad2 = tf.grad...
原创
2019-10-14 22:14:39 ·
1344 阅读 ·
0 评论