随笔分类 -  tensorflow

摘要:参见https://www.cnblogs.com/marsggbo/p/11232897.html、https://yuanmingqi.blog.csdn.net/article/details/84111065 前言:Estimator 是 一种可极大地简化机器学习编程的高阶 TensorFl 阅读全文
posted @ 2021-09-06 22:44 shines87 阅读(341) 评论(0) 推荐(0)
摘要:简介: 特征列(feature columns)是原始数据和 Estimator 之间的媒介,特征列形式丰富多样 但需要转换为神经网络唯一可以处理的类型。 常见的特征预处理方法包括:连续变量分箱化、离散变量one-hot、离散指标embedding等。在feature_column接口实现的9种不同 阅读全文
posted @ 2021-09-06 14:19 shines87 阅读(821) 评论(0) 推荐(0)
摘要:一、tf.Graph 一个程序中可定义多个图,只有一个默认图。在每个图中绘制tf数据与操作,最后使用sess会话执行,图与sess是多对多的关系。 一般情况下tf不需要指定设备,tf自动检测 优先'gpu:0' 然后'cpu:0',默认'gpu:1'不参与运算 cpu不区分设备号。 ①图的定义 tf 阅读全文
posted @ 2021-08-31 12:20 shines87 阅读(459) 评论(0) 推荐(0)
摘要:一、tf.nn.库 1、常用函数 ①tf.nn.relu() # 大于0的数保持不变,小于0的数置为0.eg:tf.nn.relu(np.array([[-40,0.4],[0.5,50]])) ②tf.nn.bias_add(x,y) # 向量y与矩阵x的每一行相加 eg: ③tf.nn.conv 阅读全文
posted @ 2021-08-30 21:52 shines87 阅读(326) 评论(0) 推荐(0)
摘要:一、tensorflow常用方法 ①tf函数 tf.clip_by_value(x, min, max) # 把tensor变量x中大于min的置为min,把x中小于max的元素值置为max。 tf.cast(x, tf.float32) # 用于改变张量的数据类型 tf.convert_to_te 阅读全文
posted @ 2021-08-29 17:00 shines87 阅读(206) 评论(0) 推荐(0)
摘要:一、tensorflow基本使用 1、tf基本用法 import tensorflow as tf ①创建变量 tf.constant(val, dtype=None,shape=None,name='Const', verify_shape=False) tf.fill(dims, value, 阅读全文
posted @ 2021-08-28 19:40 shines87 阅读(370) 评论(0) 推荐(0)
摘要:项目地址 https://github.com/chunjiangwong/TensorFlow-Tutorials-Chinese 一、Inception网络 08_Transfer_Learning_CN 1、加载Inception模型,从‘中间层’softmax:0中取出数据。示例: impo 阅读全文
posted @ 2021-08-28 00:11 shines87 阅读(75) 评论(0) 推荐(0)
摘要:项目地址 https://github.com/chunjiangwong/TensorFlow-Tutorials-Chinese 一、原始卷积02_Convolutional_Neural_Network_CN 1、数据参数 import tensorflow.compat.v1 as tf t 阅读全文
posted @ 2021-08-27 19:46 shines87 阅读(86) 评论(0) 推荐(0)