Tensorboard可视化
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 5 09:29:36 2017
@author: Admin
"""
import tensorflow as tf
def add_layer(inputs ,in_size, out_size, activation_function = None):
with 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_b
else:
outputs = activation_function(Wx_plus_b)
return outputs
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')
l1 = add_layer(xs, 1, 10, activation_function = tf.nn.relu)
prediction = add_layer(l1, 10, 1, activation_function = None)
with tf.name_scope('loss'):
loss = tf.reduce_mean(tf.reduce_sum(tf.square(ys - prediction, name='square'), reduction_indices = [1], name='reduce_sum'),
name='reduce_mean')
with tf.name_scope('train'):
train_step = tf.train.GradientDescentOptimizer(0.1).minimize(loss)
sess = tf.Session()
#writer = tf.train.SummaryWriter("/logs",sess.graph)
writer = tf.summary.FileWriter("D://path/to/log", sess.graph)
sess.run(tf.global_variables_initializer())
cmd >> tensorboard --logdir=D://path/to/log
浏览器:http://localhost:6006/#graphs
(控制台每运行一次,train一个神经网络进行可视化)
(控制台每多run一个文件,多可视化一个文件的图像,清除 -> 关闭控制台重启)
(D://path/to/log 表示在D盘下生成path文件夹,关闭控制台后才可以删除该文件夹)
Tensorboard可视化的更多相关文章
- Tensorflow学习笔记3:TensorBoard可视化学习
TensorBoard简介 Tensorflow发布包中提供了TensorBoard,用于展示Tensorflow任务在计算过程中的Graph.定量指标图以及附加数据.大致的效果如下所示, Tenso ...
- 学习TensorFlow,TensorBoard可视化网络结构和参数
在学习深度网络框架的过程中,我们发现一个问题,就是如何输出各层网络参数,用于更好地理解,调试和优化网络?针对这个问题,TensorFlow开发了一个特别有用的可视化工具包:TensorBoard,既可 ...
- tensorboard可视化节点却没有显示图像的解决方法---注意路径问题加中文文件名
问题:完成graph中的算子,并执行tf.Session后,用tensorboard可视化节点时,没有显示图像 1. tensorboard 1.10 我是将log文件存储在E盘下面的,所以直接在E盘 ...
- 在Keras中使用tensorboard可视化acc等曲线
1.使用tensorboard可视化ACC,loss等曲线 keras.callbacks.TensorBoard(log_dir='./Graph', histogram_freq= 0 , wri ...
- 超简单tensorflow入门优化程序&&tensorboard可视化
程序1 任务描述: x = 3.0, y = 100.0, 运算公式 x×W+b = y,求 W和b的最优解. 使用tensorflow编程实现: #-*- coding: utf-8 -*-) im ...
- 使用TensorBoard可视化工具
title: 使用TensorBoard可视化工具 date: 2018-04-01 13:04:00 categories: deep learning tags: TensorFlow Tenso ...
- 利用tensorboard可视化checkpoint模型文件参数分布
写在前面: 上周微调一个文本检测模型seglink,将特征提取层进行冻结,只训练分类回归层,然而查看tensorboard发现里面有histogram显示模型各个参数分布,看了目前这个训练模型参数分布 ...
- 【猫狗数据集】利用tensorboard可视化训练和测试过程
数据集下载地址: 链接:https://pan.baidu.com/s/1l1AnBgkAAEhh0vI5_loWKw提取码:2xq4 创建数据集:https://www.cnblogs.com/xi ...
- 使用 TensorBoard 可视化模型、数据和训练
使用 TensorBoard 可视化模型.数据和训练 在 60 Minutes Blitz 中,我们展示了如何加载数据,并把数据送到我们继承 nn.Module 类的模型,在训练数据上训练模型,并在测 ...
- tensorflow Tensorboard可视化-【老鱼学tensorflow】
tensorflow自带了可视化的工具:Tensorboard.有了这个可视化工具,可以让我们在调整各项参数时有了可视化的依据. 本次我们先用Tensorboard来可视化Tensorflow的结构. ...
随机推荐
- virtualenv安装及使用
环境 Windows 10 python 3.6.7 安装 virtualenv用于创建虚拟环境,用于隔离不同的python版本的运行,是容器类软件.这里在Windows下通过pip安装: pip i ...
- SpringBoot参数注解
1.@RequestParam有无区别 1.1 @GetMapping("/name/id")public Result managerNameIsRepeat(@RequestP ...
- 无向图 解决Unity地图上固定网络上,标记走固定步数能到达的位置
首先需要了解无向图的定义 参考:https://www.cnblogs.com/wxgblogs/p/5572391.html 我们选择链表的方式进行操作. int StartPositon; int ...
- 关于Java中static关键字的用法以及从内存角度解析
在Java中,static可以用来修饰成员变量和成员方法. 修饰成员变量,称为静态成员方法 修饰静态方法,称为静态成员方法 搞清楚用法和区别之前,先搞清static声明的变量和普通非静态变量在内存的分 ...
- 主席树套树状数组——带修区间第k大zoj2112
主席树带修第k大 https://www.cnblogs.com/Empress/p/4659824.html 讲的非常好的博客 首先按静态第k大建立起一组权值线段树(主席树) 然后现在要将第i个值从 ...
- 学习笔记_J2EE_SpringMVC_02_注解配置
SpringMVC注解配置 1.测试环境: 名称 版本 备注 操作系统 Windows10 专业版1809X64 WEB服务器 Tomcat 8.5 X64 浏览器 Google Chrome ...
- python绘制等边三角形
定义一个函数,参数为三角形的边长和颜色,并调用该函数绘制两个边长颜色不同的等边三角形 def draw(l,color): import turtle turtle.setup(900,600,200 ...
- MIUI11系统怎么样启用root权限的教程
MIUI11系统如何启用了ROOT超级权限?做开发的人都知道,安卓机器有ROOT超级权限,一旦手机启用了root相关权限,可以实现更多的功能,举个例子做开发的人公司的营销部门的妹纸,使用较多营销工具都 ...
- 2018年冬季寒假作业4--PTA 币值转换
1. 实验代码: #include<stdio.h> int main (void) { int n, initial_n; scanf("%d", &n); ...
- css选择器+、~、>
在css中,选择器是一种模式,用于选择需要添加样式的元素.它有多种选择器,我们看一下比较常见,但容易混淆的三个选择器+.~.> A + B(相邻兄弟选择器) 定义:css2. 匹配B元素,满足条 ...