array([0.,0.,0.,0.,0.,0.,1.,0.,0.,0])
mnist.train.images[0]
x=tf.constant([[1,2],[1,2]]) y=tf.constant([[1,1],[1,2]]) z=tf.add(x,y) print z
[[2,3],[2,4]]
A = tf.convert_to_tensor(np.array([[1,1,2,4], [3,4,8,5]])) print A.dtype b = tf.cast(A, tf.float32) print b.dtype
A = [[1,3,4,5,6]] B =[[1,3,4,3,2]] with tf.Session( ) as sess: print(sess.run(tf.equal(A, B)))
[[True True True False False]]
x = [[1., 1.][2., 2.]] print(tf.reduce_mean(x))
print(tf.reduce_mean(x, 0))
print(tf.reduce_mean(x, 1))
correct_prediction= tf.equal(tf.argmax(y, 1), tf.argmax(y_, 1)) accuracy =tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
def forward(x, regularizer):
def=== return y def get_weight(shape, regularizer): def
learning_rate = tf.train.exponential_decay( LEARNING_RATE_BASE, global_step, LEARNING_RATE_STEP, LEARNING_RATE_DECAY, staircase=True)
原文:https://www.cnblogs.com/xiaojianliu/p/9363305.html