Tensorflow While循环的变量创建代码如下:
x = tf.Variable(100)
c = tf.Constant(2)
n = 100
loops = 50
l1 = tf.Variable(np.random.random(n))
c1 = tf.Variable(np.random.random(n))
x = tf.multiply(c1,tf.exp(-(x-l1)/c))
l2 = tf.Variable(np.random.random(n))
c2 = tf.Variable(np.random.random(n))
x = tf.multiply(c2,tf.exp(-(x-l2)/c))
l3 = tf.Variable(np.random.random(n))
c3 = tf.Variable(np.random.random(n))
x = tf.multiply(c3,tf.exp(-(x-l3)/c))
.....
.....
l50 = tf.Variable(np.random.random(n))
c50 = tf.Variable(np.random.random(n))
x = tf.multiply(c50,tf.exp(-(x-l50)/c))
所以,我想在tensorflow的while循环中这样做:
^{pr2}$
如何在tensorflow中实现这一点。
谢谢你
你能这样喂它吗?在
根据你的评论,我只是试图。这不是确切的答案。在
^{pr2}$相关问题 更多 >
编程相关推荐