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