摘要: tf.argmax(input, dimension, name=None) 参数: input:输入数据 dimension:按某维度查找。 dimension=0:按列查找; dimension=1:按行查找; 返回: 最大值的下标 输出: 4 输出: [3, 2, 2] 输出: [2, 0 , 阅读全文
posted @ 2018-08-16 21:56 章朔 阅读(2096) 评论(0) 推荐(0) 编辑
摘要: 1.常量生成函数 tf.constant(value, dtype) 生成一个初始值为常量value的数组 value:指定的常量 dtype:数据类型 tf.zeros(shape, dtype) 生成一个形状为shape、初始值全为0的数组 tf.ones(shape, dtype) 生成一个形 阅读全文
posted @ 2018-08-16 21:44 章朔 阅读(673) 评论(0) 推荐(0) 编辑
摘要: 1.初始化为常量 tf.constant_initializer(value, dtype) 生成一个初始值为常量value的tensor对象 value:指定的常量 dtype:数据类型 tf.zeros_initializer(dtype) 生成一个初始值全为0的tensor对象 tf.ones 阅读全文
posted @ 2018-08-16 21:29 章朔 阅读(5225) 评论(0) 推荐(1) 编辑
摘要: tf.trainable_variable() 此函数返回的是需要训练的变量列表 tf.all_variable() 此函数返回的是所有变量列表 是不是训练变量:主要根据 tf.Variable() 和 tf.get_variable() 中参数 trainable 设定的 阅读全文
posted @ 2018-08-16 16:16 章朔 阅读(523) 评论(0) 推荐(0) 编辑
摘要: tf.name_scope() 此函数作用是共享变量。在一个作用域scope内共享一些变量,简单来说,就是给变量名前面加个变量空间名,只限于tf.Variable()的变量 tf.variable_scope() 和tf.name_scope()作用一样,不过包括tf.get_variable()的 阅读全文
posted @ 2018-08-16 14:35 章朔 阅读(3852) 评论(0) 推荐(0) 编辑
摘要: tf.Variable(<initial - value>,name=<optional - name>) 此函数用于定义图变量。生成一个初始值为initial - value的变量。 tf.get_variable(name,shape,dtype,initializer,trainable) 此 阅读全文
posted @ 2018-08-16 13:36 章朔 阅读(6623) 评论(0) 推荐(0) 编辑
摘要: tf.placeholder(dtype, shape=None, name=None) 此函数用于定义过程,在执行的时候再赋具体的值 参数: dtype:数据类型。常用的是tf.float32,tf.float64等数值类型 shape:数据形状。默认是None,就是一维值,也可以多维,比如:[N 阅读全文
posted @ 2018-08-16 13:04 章朔 阅读(20476) 评论(0) 推荐(0) 编辑