tensorflow
Hhaicl
hello world
展开
-
tensorflow参数共享
tensorflow参数共享 要用到额外的函数:tf.trainable_variables(), 它能够将我们定义的所有的 trainable=True 的所有变量以一个list的形式返回 tensorflow三种创建变量的方式:1 tf.placeholder方法 v1 = tf.placeholder(dtype= tf.float32 , shape = (3,3))print(v1.n...原创 2018-11-09 22:17:29 · 2010 阅读 · 0 评论 -
tf.stack()与tf.unstack()函数
tf.stack()是一个矩阵拼接函数,即将秩为 R 的张量列表堆叠成一个秩为 (R+1) 的张量。 import tensorflow as tf a = tf.constant([[1,2,3],[4,5,6]]) b = tf.constant([[7,8,9],[0,1,7]]) c = tf.stack([a,b],axis = 0) with tf.Session() as se...转载 2018-11-05 16:05:37 · 8631 阅读 · 0 评论