可视化好助手 Tensorboard

  • 4.1 Tensorboard 可视化好帮手1
  • 4.2 Tensorboard 可视化好帮手2

4.1 Tensorboard 可视化好帮手1

  • 效果
  • 搭建图纸
  • 可能会遇到的问题

注意: 本节内容会用到浏览器, 而且与 tensorboard 兼容的浏览器是 Google Chrome. 使用其他的浏览器不保证所有内容都能正常显示.
学会用 Tensorflow 自带的 tensorboard 去可视化我们所建造出来的神经网络是一个很好的学习理解方式. 用最直观的流程图告诉你你的神经网络是长怎样,有助于你发现编程中间的问题和疑问.

相关代码:

# View more python learning tutorial on my Youtube and Youku channel!!!# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial"""
Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly.
"""
from __future__ import print_function
import tensorflow as tfdef add_layer(inputs, in_size, out_size, activation_function=None):# add one more layer and return the output of this layerwith tf.name_scope('layer'):with tf.name_scope('weights'):Weights = tf.Variable(tf.random_normal([in_size, out_size]), name='W')with tf.name_scope('biases'):biases = tf.Variable(tf.zeros([1, out_size]) + 0.1, name='b')with tf.name_scope('Wx_plus_b'):Wx_plus_b = tf.add(tf.matmul(inputs, Weights), biases)if activation_function is None:outputs = Wx_plus_belse:outputs = activation_function(Wx_plus_b, )return outputs# define placeholder for inputs to network
with tf.name_scope('inputs'):xs = tf.placeholder(tf.float32, [None, 1], name='x_input')ys = tf.placeholder(tf.float32, [None, 1], name='y_input')# add hidden layer
l1 = add_layer(xs, 1, 10, activation_function=tf.nn.relu)
# add output layer
prediction = add_layer(l1, 10, 1, activation_function=None)# the error between prediciton and real data
with tf.name_scope('loss'):loss = tf.reduce_mean(tf.reduce_sum(tf.square(ys - prediction),reduction_indices=[1]))with tf.name_scope('train'):train_step = tf.train.GradientDescentOptimizer(0.1).minimize(loss)sess = tf.Session()# tf.train.SummaryWriter soon be deprecated, use following
if int((tf.__version__).split('.')[1]) < 12 and int((tf.__version__).split('.')[0]) < 1:  # tensorflow version < 0.12writer = tf.train.SummaryWriter('logs/', sess.graph)
else: # tensorflow version >= 0.12writer = tf.summary.FileWriter("logs/", sess.graph)# tf.initialize_all_variables() no long valid from
# 2017-03-02 if using tensorflow >= 0.12
if int((tf.__version__).split('.')[1]) < 12 and int((tf.__version__).split('.')[0]) < 1:init = tf.initialize_all_variables()
else:init = tf.global_variables_initializer()
sess.run(init)# direct to the local dir and run this in terminal:
# $ tensorboard --logdir=logs

(1)效果

这次我们会介绍如何可视化神经网络。因为很多时候我们都是做好了一个神经网络,但是没有一个图像可以展示给大家看。这一节会介绍一个TensorFlow的可视化工具 — tensorboard

Tensorflow可视化好助手 Tensorboard (四)-Deep Learning相关推荐

  1. 可视化好助手Tensorboard

    Tensorboard 可视化好助手1 注意: 本节内容会用到浏览器, 而且与 tensorboard 兼容的浏览器是 "Google Chrome". 使用其他的浏览器不保证所有 ...

  2. 基于Wide Deep Learning的推荐系统

    我们先来看下Google Inc的paper:Wide & Deep Learning for Recommender Systems. 一.介绍 推荐系统可以看成是一个搜索排序系统,其中输入 ...

  3. Turning Design Mockups Into Code With Deep Learning

    原文链接地址:https://blog.floydhub.com/turning-design-mockups-into-code-with-deep-learning/ Emil Wallner o ...

  4. deep learning list

    版权声明:本文为博主原创文章,未经博主允许不得转载. Free Online Books Deep Learning by Yoshua Bengio, Ian Goodfellow and Aaro ...

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

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

  6. TensorFlow和深度学习入门教程(TensorFlow and deep learning without a P

    前言 上月导师在组会上交我们用tensorflow写深度学习和卷积神经网络,并把其PPT的参考学习资料给了我们, 这是codelabs上的教程:<TensorFlow and deep lear ...

  7. Tensorflow 可视化 TensorBoard 尝试~

    tensorboard --logdir=/home/ubuntu/temp/log 注意:在阅读本文之前,请务必更新你的浏览器.Chrome大法好!  数据.模型可视化是TensorFlow的一项重 ...

  8. 深度学习教程 TensorFlow and Deep Learning Tutorials

    Google's Deep Learning Tutorials TensorFlow Official Deep Learning Tutorial [中文]. MLP with Dropout T ...

  9. Deep Learning论文笔记之(七)深度网络高层特征可视化

    Deep Learning论文笔记之(七)深度网络高层特征可视化 zouxy09@qq.com http://blog.csdn.net/zouxy09          自己平时看了一些论文,但老感 ...

  10. TensorFlow官方教程《Neural Networks and Deep Learning》译(第一章)

    – 更新中 译自:Neural Networks and Deep Learning 成果预展示 如果你能坚持阅读完本章, 你可以获得如下的成果: 上图中的命令行窗口输出为: Epoch 0: 909 ...

最新文章

  1. LTE网元间控制面协议
  2. matlab驱动器有什么用,mongo-matlab-driver如何使用
  3. 《数据库系统实训》实验报告——数据库维护
  4. BZOJ——3343: 教主的魔法 || 洛谷—— P2801 教主的魔法
  5. sql server 性能_SQL Server硬件性能调整
  6. 无代码开发到底是不是伪需求?
  7. 支付宝手机网站即时交易 自己封装的类
  8. 如何在IOS平台上使用js直接调用OC方法(转)
  9. VEGAS Pro 18序列号 PC上最佳的入门级视频编辑软件
  10. 《深入理解计算机系统(修订版)》读感
  11. 2022年计算机软件水平考试网络工程师(中级)练习题及答案
  12. 彻底解决SP2下ALEXA工具条无法显示(转)
  13. 38000词汇词根统计
  14. 时间和天数相加并格式化
  15. win10卸载软件_教你彻底关闭Win10自动更新,以及卸载预装应用
  16. 教教你如何配置汤姆猫 和 Java 环境变量的设置
  17. LED数码管段码生成
  18. 移动支付线上线下支付应用场景
  19. 深度学习系列笔记之统计基础
  20. BCD码与十六进制值转换

热门文章

  1. win10非核心版本的计算机上
  2. AECC2019免费下载After Effects CC 2019中文完整破解版免费下载与安装教程...
  3. 机器视觉(9)搞懂机器视觉基本内容,这份PPT就够了!
  4. Ant Design学习——TimePicker
  5. Delphi 开发so库,Delphi 调用SO库
  6. 唯一索引(unique index)的创建和使用
  7. 插值算法(数学建模)
  8. 《敏捷软件开发》— 敏捷开发 — 敏捷实践
  9. idea启动vue项目
  10. Win10清理C盘垃圾