Tensorflow
取名为猫的狗
这个作者很懒,什么都没留下…
展开
-
Tensorflow 稀疏向量, 密集向量
代码:import tensorflow as tfdef getSparseTensor(): indices = [[0, 0], [1, 2]] values = [1, 2] shape = [3, 4] return indices, values, shapeif __name__ == "__main__": sparse_tens...原创 2020-04-19 16:39:07 · 412 阅读 · 0 评论 -
HWDB1.1数据集.gnt转换成.png
参考链接:https://blog.csdn.net/PeppaPeppaPeppa/article/details/89034376HWDB1.1下载:http://www.nlpr.ia.ac.cn/databases/handwriting/Offline_database.html下载获得文件1,将文件1解压获得文件2,再将文件2解压获得.gnt文件,再将单个gnt文件转换为png...原创 2020-04-14 13:42:00 · 1865 阅读 · 1 评论 -
tensorflow tf.layers.batch_normalization
http://ruishu.io/2016/12/27/batchnorm/https://blog.csdn.net/tobale/article/details/85102773https://blog.csdn.net/huitailangyz/article/details/85015611https://blog.csdn.net/computerme/article/detail...原创 2020-04-01 17:26:26 · 214 阅读 · 0 评论 -
Tensorflow TFRecord图片
创建图片:import cv2import numpy as npdef create_img(): img = np.zeros((3, 4, 3), dtype=np.uint8) img_height, img_width, img_channel = img.shape print("row: %d col: %d channel: %d" %(im...原创 2020-03-28 23:19:56 · 173 阅读 · 0 评论 -
Tensorflow padding的SAME和VALID
参考链接:https://blog.csdn.net/wuzqChom/article/details/74785643W为输入的size,F为filter的size,S为步长,⌈⌉为向上取整符号VALUE:newHeight=newWidth=⌈W−F+1S⌉newHeight = newWidth =⌈\frac{W-F+1}{S}⌉newHeight=newWidth=⌈SW−F+1...原创 2020-03-27 13:29:06 · 123 阅读 · 0 评论 -
tf.nn.relu
激活函数 relu:f(x) = max(0, x) 大于0为原值,小于0变0import tensorflow as tfinput = tf.Variable([-1, 0, 1])op = tf.nn.relu(input)init = tf.initialize_all_variables() with tf.Session() as sess: sess.run(i...原创 2020-03-27 13:01:39 · 471 阅读 · 0 评论 -
tf.layers.conv2d
参考链接:https://blog.csdn.net/gqixf/article/details/80519912conv2d(inputs, filters, kernel_size, strides=(1, 1), padding='valid', data_format='channels_last', dilation_rate=(1, 1), ...原创 2020-03-27 12:02:39 · 1793 阅读 · 0 评论 -
tf.nn.conv2d
tf.nn.conv2d( input, filter, strides, padding, use_cudnn_on_gpu=True, data_format='NHWC', dilations=[1, 1, 1, 1], name=None)参数:input:输入的要做卷积的图片,要求为一个张量,shape为 [batc...原创 2020-03-27 11:40:20 · 157 阅读 · 0 评论 -
如何取出 tf.layers.dense 定义的全连接层的weight和bias参数值
原文链接:https://www.codelast.com/%e5%8e%9f%e5%88%9b-%e5%a6%82%e4%bd%95%e5%8f%96%e5%87%ba-tf-layers-dense-%e5%ae%9a%e4%b9%89%e7%9a%84%e5%85%a8%e8%bf%9e%e6%8e%a5%e5%b1%82%e7%9a%84weight%e5%92%8cbias%e5%8f%...转载 2020-03-25 12:02:48 · 2226 阅读 · 0 评论 -
tensorflow padding
https://www.cnblogs.com/White-xzx/p/9497029.html转载 2020-03-02 11:20:05 · 118 阅读 · 0 评论 -
Tensorflow 房价预测
原文链接:https://blog.csdn.net/Mind_programmonkey/article/details/89606115数据处理import osimport numpy as npimport pandas as pd# 定义标准化的函数def normalize_feature(df): return df.apply(lambda column:(c...原创 2020-02-29 17:29:10 · 291 阅读 · 0 评论 -
TensorFlow tf.nn.softmax_cross_entropy_with_logits
参考链接:https://blog.csdn.net/yhily2008/article/details/80262321https://blog.csdn.net/mao_xiao_feng/article/details/53382790https://www.jianshu.com/p/695136c5647b函数说明:tf.nn.softmax_cross_entropy_wit...原创 2020-02-29 15:47:59 · 300 阅读 · 0 评论 -
Tensorflow tf.reduce_sum()
原文链接:https://www.jianshu.com/p/30b40b504baehttps://blog.csdn.net/u012193416/article/details/83349138tf.reduce_sum()说明reduce_sum() 用于计算张量tensor沿着某一维度的和,可以在求和后降维。tf.reduce_sum( input_tensor, ...原创 2020-02-29 15:46:57 · 375 阅读 · 0 评论 -
Tensorflow tf.log()
import tensorflow as tftensor = tf.constant([[1.0,2.0,3.0],[1.0,2.0,3.0],[1.0,2.0,3.0]], dtype=tf.float32)tensor_log = tf.log(tensor)with tf.Session() as sess: print("tensor:") print(sess...原创 2020-02-29 15:13:56 · 5262 阅读 · 0 评论 -
tensorflow点乘与矩阵乘
原文链接:https://www.cnblogs.com/liuq/p/9330134.html点乘和矩阵乘的区别:1. 点乘(即“ * ”) ---- 各个矩阵对应元素做乘法若 w 为 m*1 的矩阵,x 为 m*n 的矩阵,那么通过点乘结果就会得到一个 mn 的矩阵。若 w 为 m*n 的矩阵,x 为 m*n 的矩阵,那么通过点乘结果就会得到一个 mn 的矩阵。w的列数只能为 1...原创 2020-02-29 14:55:44 · 1543 阅读 · 0 评论