tensorflow的基础函数(定期更新)

版权声明:本文为博主原创文章,未经博主允许不得转载O(∩_∩)O https://blog.csdn.net/qq_38153833/article/details/86559609

写下这个是为了以后方便查看tensorflow一些函数
1.tf.nn.relu()

tf.nn.relu() 激活函数:>0不变,<0置0

2.data=[1,1,1,1,2,2,2,2]
tf.reshape(data,[-1,4]) 也就是列数为4,行数取最大值:8/4=2
tf.reshape(data,[2,-1]) 也就是行数为2,列数取最大值:8/4=4

3.tf.matmul与tf.multiply
tf.matmul 是两个矩阵相乘,tf.multiply是元素之间点乘

4.tf.interactiveSession() 与tf.session()
tf.interactiveSession() 运行图时插入计算图,如operation(),先定义session会话再定义操作
tf.session() 操作后构建session

猜你喜欢

转载自blog.csdn.net/qq_38153833/article/details/86559609