Tensorflow学习笔记一:getting started with tensorflow
来源:互联网 发布:淘宝开店不交保证金 编辑:程序博客网 时间:2024/06/06 10:00
推荐电子书:Tensorflow for Machine Intelligence
下载链接:http://download.csdn.net/detail/pjia_1008/9852144
斯坦福tensorflow课程CS20SI course notes + slides
下载链接: http://download.csdn.net/detail/pjia_1008/9852153
tensorflow游乐场:http://playground.tensorflow.org
两个月前用Tensorflow跑了FCN,现在打算系统学习一下,follow官网教程
Tensorflow的核心是创建计算图和run所创建的计算图
简单的加法例子,我理解的计算图中的node,实际上就是运算公式中的计算符号,按照计算优先级顺序,一步一步平凑成计算流程图,要得到最终计算结果,还需要run session,在session中进行tensor的参数导入和结果输出
初始化常数直接用tf.constant就可以,但是在初始化变量的时候,需要用到init初始化全局变量,例子中的w和b如果没有init,仅仅使用tf.variable并不能进行变量初始化!如果要初始化接收输入的变量,要先给变量定义占位符:
tf.train API
在tf.train 端口中,可以选择优化迭代的方法,比如SGD/gradient descent/adam/ sgd+momentum,然后在对应的train=optimizers.minimize(loss)迭代最小化损失
tf.contrib.learn
Tf.contrib.learn高层tensorflow库,主要包括分步骤训练
下图为用contrib的线性回归例子,插一句tensor和op的区别,类比一个神经元有多个输入,一个或者多个输出,这里的op可以看作神经元,tensor可以看作是输入的数据,数组或者矩阵。
1,定义模型,包括模型的变量/线性回归方程式/损失函数reduce_sum/用tf.train.get_global_step()建立全局优化器/用梯度下降法来迭代更新参数/tf.group用来集成运算,此处用来最小化损失函数,用tf.assign叠加改变step的值/返回训练模型
2,创建estimator将上一步定义好的model传入estimator中
3,定义训练数据 tf.contrib.learn.io.numpy_input_fn定义输入输出流
4,训练 estimator.fit拟合估计输出y
5,打印evaluation结果
参考材料
[1]http://www.tensorfly.cn/tfdoc/api_docs/python/control_flow_ops.html#group
[2]http://blog.csdn.net/sinat_33761963/article/details/56286408?locationNum=9&fps=1
[3]http://blog.csdn.net/ls617386/article/details/60572770
- Tensorflow学习笔记一:getting started with tensorflow
- 学习Getting Started With TensorFlow
- Getting Started with TensorFlow
- Getting started with TensorFlow
- 《Tensorflow》Getting Started with Tensorflow
- TensorFlow官方教程学习笔记之1-TensorFlow入门教程(Getting Started With TensorFlow)
- TensorFlow学习篇【1】Getting Started With TensorFlow
- TensorFlow Note 1 : Getting Started With TensorFlow
- TensorFlow学习——Getting Started With TensoFlow
- Getting started with TensorFlow on iOS
- 【附原文:深度学习-开始Tensorflow】1.Getting Started With TensorFlow
- 【TensorFlow官网搬运201704】Getting Started With TensorFlow
- Getting Started With TensorFlow(开始使用TensorFlow)
- tensorflow_cookbook:Ch 1: Getting Started with TensorFlow(8)08_Additional_Resources
- Tensorflow学习笔记1:Get Started
- TensorFlow学习笔记(一)
- TensorFlow学习笔记(一)
- tensorflow学习笔记一
- WebService到底是什么?
- 【LeetCode】561.Array Partition I解题报告
- 常用的选择器及特殊性
- 【实践mark】Git常用命令行
- Android 数据加密 MD5加密
- Tensorflow学习笔记一:getting started with tensorflow
- springAOP 常见报错
- openfire外部数据库配置 转载别人的文章
- shopNC中mysql配置主从进行读写分离的坑
- 蓝桥杯第六届决赛试题JavaB
- 乱码问题1
- 线性表的实现
- 良/恶性乳腺癌肿瘤预测
- Kotlin 相关的资料