分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.youkuaiyun.com/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
1. 将 numpy 下的多维数组(ndarray)转化为 tensor
a = np.zeros((3, 3))ta = tf.convert_to_tensor(a)with tf.Session() as sess: print(sess.run(ta))
- 1
- 2
- 3
- 4
2. 求均值
- 对于一个 numpy 下的多维数组,求均值:correct.mean()
- 如果是 tensorflow 的一个 tensor,求均值:tf.reduce_mean(tf.cast(correct, tf.float32))
给我老师的人工智能教程打call!http://blog.youkuaiyun.com/jiangjunshow
