tensorflow-learning-where-what-how
这么优秀的外国小哥哥... https://github.com/machinelearningmindset/TensorFlow-Course
tensorboard使用:https://github.com/secsilm/understanding-tensorboard
tensorflow-morvan
- placeholder:session外定义,session里面传入具体变量
- 在session外定义完整的结构,包括具体的操作、loss、减小loss的优化器optimizer,还有train(optimizer),然后再session里头run(train),变量要先初始化。
- matplotlib可视化
- 加速方法:
- SGD:把这些数据拆分成小批小批的, 然后再分批不断放入 NN 中计算,走好多曲曲折折的路
- momentum:放到斜坡上,一下子滑好远 m = b1 * m - Learning rate * dx; W += m
- AdaGrad: 加大阻力,让他拐弯的时候偏离路线不能太远 v += dx^2; W += -Learning rate * dx/ √v
- RMSProp:不完全结合上面两种方法
- Adam: 结合上面两种方法
- tensorboard:想在图里表示哪个变量就with tf.name_scope("name_val")这个东西的上边,最后在session里写tf.summary,FileWriter("logs/",sess.graph)
- 交叉熵用来衡量预测值和真实值的相似程度,如果完全相同,它们的交叉熵等于零。
- 正则化:防止过拟合,让W变大的同时cost = 预测值-真实值得平方也变大,相当于一种惩罚机制。防止过拟合还可以用dropout,每次训练在这一层随机忽略掉一些神经元和神经联结。
- saver&loader:先定义with save,之后再使用
- cnn: tf.nn.conv2d函数是tensoflow里面的二维的卷积函数,x是图片的所有参数,W是此卷积层的权重,然后定义步长strides=[1,1,1,1]值,strides[0]和strides[3]的两个1是默认值,中间两个1代表padding时在x方向运动一步,y方向运动一步,padding采用的方式是SAME。
- call():在python中,函数和类都可以变成可调用对象,讲解例子。函数的调用是def 之后在外部function(input),类的调用是先定义class类 class a(),之后在外部声明初始化这个类function = a(),最后在声明之后便都可以调用类内的__call__部分print(function(input))。由此可以看出,只看最后一行的话,类和函数的外部调用是一样的。
tensorboard
- 莫烦de, 这个可以同时参照老版的和他发布的那个2017年新版的tf,可以get到图层和变量的概念
- 定义那个graph里都有什么变量就用with tf.name_scope('name') or tf.variable_balabala, 就比方说你想要显示w和b,还有大的这个是什么层,就是画图层,大圈套小圈
with tf.name_scope('layer_name'):
with tf.variable_name('w'):
w = tf.takeplace_balabala
- 想得到直方图啥的,就比方说loss和accuracy,就在model.py文件里定义loss和accuracy变量那先给变量起个名,然后在下边加句add_summary啥玩意就行了
self.accuracy = tf.reduce_mean(tf.cast(self.correct_pred, tf.float32),name = 'accuracy')
tf.summary.scalar('accuracy',self.accuracy) # 这里可以summary.histgram总之想要什么图,就加什么图
tensorflow-learning-where-what-how的更多相关文章
- 基于TensorFlow的MNIST数据集的实验
一.MNIST实验内容 MNIST的实验比较简单,可以直接通过下面的程序加上程序上的部分注释就能很好的理解了,后面在完善具体的相关的数学理论知识,先记录在这里: 代码如下所示: import tens ...
- TensorFlow图像预处理-函数
更多的基本的API请参看TensorFlow中文社区:http://www.tensorfly.cn/tfdoc/api_docs/python/array_ops.html 下面是实验的代码,可以参 ...
- TensorFlow加载图片的方法
方法一:直接使用tensorflow提供的函数image = tf.gfile.FastGFile('PATH')来读取一副图片: import matplotlib.pyplot as plt; i ...
- tensorflow中slim模块api介绍
tensorflow中slim模块api介绍 翻译 2017年08月29日 20:13:35 http://blog.csdn.net/guvcolie/article/details/77686 ...
- Introduction to TensorFlow
Lecture note 1: Introduction to TensorFlow Why TensorFlow TensorFlow was originally created by resea ...
- 利用阿里云容器服务打通TensorFlow持续训练链路
本系列将利用Docker和阿里云容器服务,帮助您上手TensorFlow的机器学习方案 第一篇:打造TensorFlow的实验环境 第二篇:轻松搭建TensorFlow Serving集群 第三篇:打 ...
- (转)Awsome Domain-Adaptation
Awsome Domain-Adaptation 2018-08-06 19:27:54 This blog is copied from: https://github.com/zhaoxin94/ ...
- Summary on deep learning framework --- TensorFlow
Summary on deep learning framework --- TensorFlow Updated on 2018-07-22 21:28:11 1. Check failed: s ...
- TensorFlow和深度学习-无需博士学位(TensorFlow and deep learning without a PhD)
1. 概述 原文地址: TensorFlow and deep learning,without a PhD Learn TensorFlow and deep learning, without a ...
- 第25月第5天 Hands-on Machine Learning with Scikit-Learn and TensorFlow
1.apachecn视频(机器学习实战) https://github.com/apachecn/AiLearning https://space.bilibili.com/97678687/#/ch ...
随机推荐
- 字符串hash
hash[i]=(hash[i-1]*p+idx(s[i]))%mod p和mod取不同的较大的素数
- ubuntu opencv
sudo apt-get updatesudo apt-get upgrade sudo apt-get install build-essential libgtk2.0-dev libjpeg-d ...
- 【Java】【6】JDK8 Stream操作整理
摘要: 1,List<EntityOld>转换为List<EntityNew> List<EntityOld> list = oldList; List<En ...
- python-flask-SQLAlchemy-Utils组件
SQLAlchemy-Utils,提供choice功能 定义: # pip3 install sqlalchemy-utils from sqlalchemy_utils import ChoiceT ...
- R12 查询EBS用户相关SQL(转)
https://www.cnblogs.com/quanweiru/p/4869697.html http://hutianci.iteye.com/blog/934921 --R12查询EBS在线用 ...
- InnoDB存储引擎的 B+ 树索引
B+ 树是为磁盘设计的 m 叉平衡查找树,在B+树中,所有的记录都是按照键值的大小,顺序存放在同一层的叶子节点上,各叶子节点组成双链表.叶节点是数据,非叶节点是索引. 首先,需要清楚:B+ 树索引并不 ...
- 构建RESTful API(十八)
首先,回顾并详细说明一下在快速入门中使用的@Controller.@RestController.@RequestMapping注解.如果您对Spring MVC不熟悉并且还没有尝试过快速入门案例,建 ...
- 锚点 , angular 锚点 vue锚点
因为最近在开发angular,自己有路由 用window.location跳到默认路由,查了半天用angular方式不好解决 ,so 原生走起 START scrollIntoView是一个与页面(容 ...
- samba共享文件夹设置
sudo apt-get install samba(4) mkdir /home/用户名/share (新建share文件夹) sudo cp /etc/samba/smb.conf /etc/sa ...
- 【Java算法】求质数的算法
计算100以内的质数 1.质数:大于1的整数中,只能被自己和1整除的数为质数. 如果这个数,对比自己小1至2之间的数字,进行求余运算,结果都不等于0,则可以判断该数为质数. public class ...