摘要:
1.常量生成函数 tf.constant(value, dtype) 生成一个初始值为常量value的数组 value:指定的常量 dtype:数据类型 tf.zeros(shape, dtype) 生成一个形状为shape、初始值全为0的数组 tf.ones(shape, dtype) 生成一个形 阅读全文
摘要:
1.初始化为常量 tf.constant_initializer(value, dtype) 生成一个初始值为常量value的tensor对象 value:指定的常量 dtype:数据类型 tf.zeros_initializer(dtype) 生成一个初始值全为0的tensor对象 tf.ones 阅读全文
摘要:
tf.trainable_variable() 此函数返回的是需要训练的变量列表 tf.all_variable() 此函数返回的是所有变量列表 是不是训练变量:主要根据 tf.Variable() 和 tf.get_variable() 中参数 trainable 设定的 阅读全文
摘要:
tf.name_scope() 此函数作用是共享变量。在一个作用域scope内共享一些变量,简单来说,就是给变量名前面加个变量空间名,只限于tf.Variable()的变量 tf.variable_scope() 和tf.name_scope()作用一样,不过包括tf.get_variable()的 阅读全文
摘要:
tf.Variable(<initial - value>,name=<optional - name>) 此函数用于定义图变量。生成一个初始值为initial - value的变量。 tf.get_variable(name,shape,dtype,initializer,trainable) 此 阅读全文
摘要:
tf.placeholder(dtype, shape=None, name=None) 此函数用于定义过程,在执行的时候再赋具体的值 参数: dtype:数据类型。常用的是tf.float32,tf.float64等数值类型 shape:数据形状。默认是None,就是一维值,也可以多维,比如:[N 阅读全文