人工智能实践:全连接网络基础

匿名 (未验证) 提交于 2019-12-03 00:43:02

 

 

 

 

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!