参考:中国大学MOOC 北京大学 曹健《TensorFlow笔记》
基于TensorFlow的NN:用张量表示数据,用计算图搭建神经网络,用会话执行计算图,优化线上的权重(参数),得到模型。
张量(tensor):多维数组
阶:张量的维数
维数 阶 名字 例子
0-D 0 标量 s=1 2 3
1-D 1 向量 v=[1,2,3]
2-D 2 矩阵 m=[[1,2,3],[4,5,6]]
3-D 3 张量 t=[[...
张量可以表示0阶到n阶的数组(列表)
import tensorflow as tf a = tf.constant([1.0,2.0]) b = tf.constant([3.0,4.0]) result = a + b print result
计算图只描述计算过程,不计算结果。