摘要: 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) 编辑
摘要: 1 import tensorflow as tf 2 import matplotlib.pyplot as plt 3 4 image_raw_data = tf.gfile.GFile("./picture.jpg", "rb").read() 5 with tf.Session() as sess: 6 """ 7 图像编码解码处理 8 ... 阅读全文
posted @ 2018-08-14 20:00 章朔 阅读(1903) 评论(0) 推荐(0) 编辑
摘要: 使用语句: 读取图像时报错如下: 原因: 0x92 即 10010010,UTF8 中编码一个字符的第一个字节(start byte)只可能是 0xxxxxxx、110xxxxx、1110xxx、11110xxx……而后面的字节只可能是 10xxxxxx。也就是说 0x92 只能作为后面的字节,却出 阅读全文
posted @ 2018-08-14 15:44 章朔 阅读(22195) 评论(0) 推荐(1) 编辑
摘要: 导入模块 绘制条形图 countplot(data:数据集, x:x坐标轴, color:条形图颜色, order:排序) color_palette():返回一个RGB元组列表 xticks(rotation:旋转度数):更改绘制x轴标签方向(与水平方向的逆时针夹角度数) yticks(rotat 阅读全文
posted @ 2018-06-24 22:39 章朔 阅读(1935) 评论(0) 推荐(0) 编辑
摘要: 测试结果: 阅读全文
posted @ 2018-06-20 17:20 章朔 阅读(770) 评论(0) 推荐(0) 编辑