这么优秀的外国小哥哥... 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

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的更多相关文章

  1. 基于TensorFlow的MNIST数据集的实验

    一.MNIST实验内容 MNIST的实验比较简单,可以直接通过下面的程序加上程序上的部分注释就能很好的理解了,后面在完善具体的相关的数学理论知识,先记录在这里: 代码如下所示: import tens ...

  2. TensorFlow图像预处理-函数

    更多的基本的API请参看TensorFlow中文社区:http://www.tensorfly.cn/tfdoc/api_docs/python/array_ops.html 下面是实验的代码,可以参 ...

  3. TensorFlow加载图片的方法

    方法一:直接使用tensorflow提供的函数image = tf.gfile.FastGFile('PATH')来读取一副图片: import matplotlib.pyplot as plt; i ...

  4. tensorflow中slim模块api介绍

    tensorflow中slim模块api介绍 翻译 2017年08月29日 20:13:35   http://blog.csdn.net/guvcolie/article/details/77686 ...

  5. Introduction to TensorFlow

    Lecture note 1: Introduction to TensorFlow Why TensorFlow TensorFlow was originally created by resea ...

  6. 利用阿里云容器服务打通TensorFlow持续训练链路

    本系列将利用Docker和阿里云容器服务,帮助您上手TensorFlow的机器学习方案 第一篇:打造TensorFlow的实验环境 第二篇:轻松搭建TensorFlow Serving集群 第三篇:打 ...

  7. (转)Awsome Domain-Adaptation

    Awsome Domain-Adaptation 2018-08-06 19:27:54 This blog is copied from: https://github.com/zhaoxin94/ ...

  8. Summary on deep learning framework --- TensorFlow

     Summary on deep learning framework --- TensorFlow Updated on 2018-07-22 21:28:11 1. Check failed: s ...

  9. TensorFlow和深度学习-无需博士学位(TensorFlow and deep learning without a PhD)

    1. 概述 原文地址: TensorFlow and deep learning,without a PhD Learn TensorFlow and deep learning, without a ...

  10. 第25月第5天 Hands-on Machine Learning with Scikit-Learn and TensorFlow

    1.apachecn视频(机器学习实战) https://github.com/apachecn/AiLearning https://space.bilibili.com/97678687/#/ch ...

随机推荐

  1. android------eclipse运行错误提示 Failed to load D:\Android\sdk\build-tools\26.0.0-preview\lib\dx.jar

    更新了SDK后,在ecplise上运行项目时出现了一个问题. 一运行就提示这个错误:Your project contains error(s), please fix them before run ...

  2. pytorch学习记录

    1.pytorch中的torch.split只能将tensor分割为相等的几分,如果需要特定的需求将tensor分割开,可以用torch.index_select.使用的时候,先生成index索引,示 ...

  3. unitest discover 模板实例

    说明:测试用例和主函数分开存放

  4. Ugly Number leetcode java

    问题描述: Write a program to check whether a given number is an ugly number. Ugly numbers are positive n ...

  5. 『计算机视觉』Mask-RCNN_推断网络其二:基于ReNet101的FPN共享网络暨TensorFlow和Keras交互简介

    零.参考资料 有关FPN的介绍见『计算机视觉』FPN特征金字塔网络. 网络构架部分代码见Mask_RCNN/mrcnn/model.py中class MaskRCNN的build方法的"in ...

  6. php自动填充

    1.str_pad() 函数把字符串填充为新的长度. 2.str_pad(string,length,pad_string,pad_type) 参数 描述 string 必需.规定要填充的字符串. l ...

  7. SET构造函数

    set<int,greater<int>> S; 可以在第二个参数位置设置比较模板,效果和sort类似,less表示升序,greater表示降序.这样做的好处是为了方便应对题目 ...

  8. body当中的属性

    1. text ——文本颜色 <body text="green"> </body> 2. link ——超链接的颜色                   ...

  9. python assert使用说明

    python assert断言的作用 python assert断言是声明其布尔值必须为真的判定,如果发生异常就说明表达示为假. assert断言语句的语法格式 判断a与1.b是否一致,msg类似备注 ...

  10. nginx补丁格式说明(CVE-2016-4450为例)

    nginx安全公告地址:http://nginx.org/en/security_advisories.html CVE-2016-4450:一个特定构造的数据包,可引发nginx引用空指针,导致ng ...