129、TensorFlow计算图的可视化
import tensorflow as tf
# Build your graph
x = tf.constant([[37.0, -23.0], [1.0, 4.0]], name="inputs")
w = tf.Variable(tf.random_uniform([2, 2]), name="weights")
_y = tf.matmul(x, w, name="predict_y")
y = tf.constant([[74.0, -46.0], [2.0, 8.0]], name="target_y")
loss = tf.losses.mean_squared_error(y, _y, w)
train_op = tf.train.AdagradOptimizer(0.01).minimize(loss)
init = tf.global_variables_initializer()
with tf.Session() as sess:
sess.run(init)
# 'sess.graph' provides access to the graph used in a 'tf.Session'
writer = tf.summary.FileWriter("tmp/log/", sess.graph) # Perform your computation...
for i in range(10000):
_, loss_op = sess.run([train_op, loss])
print("The loss on step " + str(i) + " is " + str(loss_op))
if(loss_op<=0.1):
break;
writer.close()

129、TensorFlow计算图的可视化的更多相关文章
- 基于TensorFlow进行TensorBoard可视化
# -*- coding: utf-8 -*- """ Created on Thu Nov 1 17:51:28 2018 @author: zhen "&q ...
- 学习TensorFlow,TensorBoard可视化网络结构和参数
在学习深度网络框架的过程中,我们发现一个问题,就是如何输出各层网络参数,用于更好地理解,调试和优化网络?针对这个问题,TensorFlow开发了一个特别有用的可视化工具包:TensorBoard,既可 ...
- TensorFlow计算图,张量,会话基础知识
import tensorflow as tf get_default_graph = "tensorflow_get_default_graph.png" # 当前默认的计算图 ...
- Tensorflow 之 TensorBoard可视化Graph和Embeddings
windows下使用tensorboard tensorflow 官网上的例子程序都是针对Linux下的:文件路径需要更改 tensorflow1.1和1.3的启动方式不一样 :参考:Running ...
- 125、TensorFlow计算图的执行
# TensorFlow使用tf.Session类来表示客户端程序之间的链接 # 虽然一个在其他语言中相似的接口也是可以使用的,列如C++ runtime # 一个tf.Session对象提供了访问本 ...
- Tensorflow细节-Tensorboard可视化-简介
先搞点基础的 注意注意注意,这里虽然很基础,但是代码应注意: 1.从writer开始后边就错开了 2.writer后可以直接接writer.close,也就是说可以: writer = tf.summ ...
- 127、TensorFlow 计算图执行(二)
import tensorflow as tf # Define a placeholder that expects a vector of three floating-point values ...
- 88、展示Tensorflow计算图上每个节点的基本信息以及运行时消耗的时间和空间
''' Created on May 24, 2017 @author: p0079482 ''' #使用程序输出日志 import tensorflow as tf with tf.Session( ...
- tensorflow-TensorBoard
Tensorborad--> 是Tensorflow的可视化工具,它可以通过Tensorflow程序运行过程中输出的日志文件可视化Tensorflow程序的运行状态.Tensorflow和Ten ...
随机推荐
- dom元素的自上而下自动滚动
dom元素的自上而下自动滚动 <!doctype html> <html lang="en"> <head> <meta charset= ...
- python基础-9.1 面向对象进阶 super 类对象成员 类属性 私有属性 查找源码类对象步骤 类特殊成员 isinstance issubclass 异常处理
上一篇文章介绍了面向对象基本知识: 面向对象是一种编程方式,此编程方式的实现是基于对 类 和 对象 的使用 类 是一个模板,模板中包装了多个“函数”供使用(可以讲多函数中公用的变量封装到对象中) 对象 ...
- Linux内核模块(Module)初解
#include <linux/init.h> // __init __exit #include <linux/module.h> // module_init module ...
- dfs(枚举)
http://codeforces.com/gym/100989/problem/L L. Plus or Minus (A) time limit per test 1.0 s memory lim ...
- 使用git版本管理时的免密问题
方式1 使用ssh 方式 方式2 使用命令 git config --global credential.helper store 会把密码存放到当前用户的home目录下的 该文件中 [root@ ...
- 在eclipse上配置多个jdk
在实际生产中,可能会遇到这样的问题:在eclipse中存在多个项目时,可能不同的项目需要不同的jdk版本.这时,我们就可以给eclipse配置多个jdk进行切换. 注:貌似只有较新版eclipse才能 ...
- D Makoto and a Blackboard
Makoto and a Blackboard time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- 时间选择器moment格式化存在时差问题
时间选择器moment格式化存在时差问题解决方法: return moment(date).utc().zone(+6).format('YYYY-MM-DD')解决IE9时间选择器不能回显数据解决方 ...
- Bootstrap框架如何设置导入链接
bootstrap文件划分: 导入规则: 方式一:可以先下载 ----https://v3.bootcss.com/ (1) 注意事项: (2) (3) 注意1:bootstrap中的js文件依赖于j ...
- [AHOI2008]紧急集合 / 聚会(LCA)
[AHOI2008]紧急集合 / 聚会 题目描述 欢乐岛上有个非常好玩的游戏,叫做"紧急集合".在岛上分散有N个等待点,有N-1条道路连接着它们,每一条道路都连接某两个等待点,且通 ...