tensorflow summary
定义summary
writer = tf.summary.FileWriter(logdir=self.han_config.log_path, graph=session.graph)
1.scalar存储结果
a.先在训练的循环外定义:
test_accuracy_summary = tf.summary.scalar('test_accuracy', self.han_model.accuracy)
test_loss_summary = tf.summary.scalar('test_loss', self.han_model.loss)
test_scalar = tf.summary.merge([test_accuracy_summary, test_loss_summary])
b.在session run的时候run test_scalar,获得值,然后再添加。
writer.add_summary(summary=train_scalar_, global_step=steps)
2.histogram存储权重,偏执。
a.先在训练的循环外定义:
W_w_attention_word_histogram = tf.summary.histogram('W_w_attention_word', self.han_model.W_w_attention_word)
W_b_attention_word_histogram = tf.summary.histogram('W_w_attention_word', self.han_model.W_b_attention_word)
context_vecotor_word_histogram = tf.summary.histogram('context_vecotor_word',
self.han_model.context_vecotor_word)
W_w_attention_sentence_histogram = tf.summary.histogram('W_w_attention_sentence',
self.han_model.W_w_attention_sentence)
W_b_attention_sentence_histogram = tf.summary.histogram('W_b_attention_sentence',
self.han_model.W_b_attention_sentence)
context_vecotor_sentence_histogram = tf.summary.histogram('context_vecotor_sentence',
self.han_model.context_vecotor_sentence)
train_variable_histogram = tf.summary.merge([W_w_attention_word_histogram, W_b_attention_word_histogram,
context_vecotor_word_histogram, W_w_attention_sentence_histogram,
W_b_attention_sentence_histogram, context_vecotor_sentence_histogram])
b.在session run的时候run test_scalar,获得值,然后再添加。
writer.add_summary(summary=train_variable_histogram_, global_step=steps)
tensorflow summary的更多相关文章
- Tensorflow Summary用法
本文转载自:https://www.cnblogs.com/lyc-seu/p/8647792.html Tensorflow Summary用法 tensorboard 作为一款可视化神器,是学习t ...
- tensorflow API _ 5 (tensorflow.summary)
tensorflow的可视化是使用summary和tensorboard合作完成的. 基本用法 首先明确一点,summary也是op. 输出网络结构 with tf.Session() as sess ...
- tensorflow summary demo with linear-model
tf.summary + tensorboard 用来把graph图中的相关信息,如结构图.学习率.准确率.Loss等数据,写入到本地硬盘,并通过浏览器可视化之. 整理的代码如下: import te ...
- 通俗易懂之Tensorflow summary类 & 初识tensorboard
前面学习的cifar10项目虽小,但却五脏俱全.全面理解该项目非常有利于进一步的学习和提高,也是走向更大型项目的必由之路.因此,summary依然要从cifar10项目说起,通俗易懂的理解并运用sum ...
- Tensorflow学习笔记——Summary用法
tensorboard 作为一款可视化神器,可以说是学习tensorflow时模型训练以及参数可视化的法宝. 而在训练过程中,主要用到了tf.summary()的各类方法,能够保存训练过程以及参数分布 ...
- TensorFlow —— Demo
import tensorflow as tf g = tf.Graph() # 创建一个Graph对象 在模型中有两个"全局"风格的Variable对象:global_step ...
- 【学习笔记】tensorflow基础
目录 认识Tensorflow Tensorflow特点 下载以及安装 Tensorflow初体验 Tensorflow进阶 图 op 会话 Feed操作 张量 变量 可视化学习Tensorboard ...
- TensorFlow API 汉化
TensorFlow API 汉化 模块:tf 定义于tensorflow/__init__.py. 将所有公共TensorFlow接口引入此模块. 模块 app module:通用入口点脚本. ...
- tensorflow加载embedding模型进行可视化
1.功能 采用python的gensim模块训练的word2vec模型,然后采用tensorflow读取模型可视化embedding向量 ps:采用C++版本训练的w2v模型,python的gensi ...
随机推荐
- HDU 3455 Leap Frog 2016-09-12 16:34 43人阅读 评论(0) 收藏
Leap Frog Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- HDU2577 How to Type 2016-09-11 14:05 29人阅读 评论(0) 收藏
How to Type Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tota ...
- hdu 5045 N个人做M道题的正确率
http://acm.hdu.edu.cn/showproblem.php?pid=5045 给出N个人做M道题的正确率,每道题只能由一个人做出,并且当所有人都做出来且仅做出一道题时,做过题的人才可以 ...
- 发个招聘贴,魔都求手游C++后端,UNITY前端,开发实习生
上海游旺网络科技有限公司成立于2015年5月,是一家极具潜力的新创移动游戏公司.公司初创团队均来自腾讯,盛大,畅游,墨麟,蜗牛等知名互联网公司,公司创始人团队参与制作过<鬼吹灯><Q ...
- Android Studio Genyomtion配置
在AndroidStudio里面点击 File -> Settings 在Settings界面中,选择Plugins 在Plugins,输入Genymotion,并点击下面的链接 点击Insta ...
- 【转】C#发送Email邮件
转自:http://hi.baidu.com/bluesky_cn/item/8bb060ace834c53f020a4df2 下面用到的邮件账号和密码都不是真实的,需要测试就换成自己的邮件账号. 需 ...
- Sharepoint/Project Server 看不到“安全性”菜单以及子菜单
在Sharepoint/Project Server 构建后,左侧看不到看不到“服务器设置”菜单,在设置菜单后左侧出现“服务器设置”菜单,但是依然在右侧看不到“安全性”菜单以及子菜单. (这个图是借的 ...
- 在TFS持续集成(持续发布)中执行Telnet任务
Telnet是一种在因特网或局域网上使用虚拟终端连接,提供双向交互式文本通信设备的协议. 它是最早的互联网通讯协议之一.自1969年启用以来,已经经过了将近50年时间,在开放式的操作系统中拥有广泛的用 ...
- .NET 日志工具 log4net使用
1.NuGet安装log4net. 2.修改配置文件 <?xml version="1.0"?> <configuration> <configSec ...
- C# winform程序实现开机自启动,并且识别是开机启动还是双击启动
开机启动程序,在很多场合都会用到,尤其是那种在后台运行的程序. 效果图: 以上两幅图都用到了命令行启动程序,为了模拟开机启动或者其他程序调用此程序. 第一幅图:程序启动可以根据不同参数,执行不同的操作 ...