人工智能实践:全连接网络基础
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