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 ...
随机推荐
- nodejs安装、环境配置和测试
nodejs下载 https://nodejs.org/en/ nodejs安装 双击下载的nodejs,可自定义安装路径,安装模块部分直接next即可安装. 检查是否安装 win+R输入cmd,打开 ...
- php数组的逐行写入文件与读取
<?php /** * * 对数组$arr1=['Apple Orange Banana Strawberry'] 写入文件,并读取 **/ class IoFile { private $pa ...
- php-fpm的错误日志
- Spring配置表友好性优化思路
Spring配置表需要尽量保证对程序员的友好性,一下提供一种优化思路. 中途未保存,心态炸了,只贴图了,fuuuuuuuuuuuuuck 第一种(最烂,最不友好):以Json的格式保存在配置表中,程序 ...
- [Fiddler] ReadResponse() failed: The server did not return a complete response for this request. Server returned 0 bytes.
待解决 [Fiddler] ReadResponse() failed: The server did not return a complete response for this request. ...
- tcpcopy真实流量压测工具
https://quentinxxz.iteye.com/blog/2249799 http://blog.chinaunix.net/uid-25057421-id-5576741.html htt ...
- java的同步实现
在java编程中,经常需要用到同步,而同步的实现使用最多的就是synchronized关键字了. synchronized关键字涉及到“锁”的概念,首先先了解一下相关锁的知识. java的内置锁:每个 ...
- json2.js 序列化 和反序列化 转
http://www.cnblogs.com/youring2/archive/2013/03/01/2938850.html json2.js的源码地址: https://github.com/do ...
- 51Nod 1001 数组中和等于K的数对
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1001一开始的想法是排序后二分搜索,发现会进行非常多不必要的遍历,十分耗时 ...
- SpringBoot配置多数据源时遇到的问题
SpringBoot配置多数据源 参考代码:Spring Boot 1.5.8.RELEASE同时配置Oracle和MySQL 原作者用的是1.5.8版本的SpringBoot,在升级到2.0.*之后 ...