官术网_书友最值得收藏!

  • Python Reinforcement Learning
  • Sudharsan Ravichandiran Sean Saito Rajalingappaa Shanmugamani Yang Wenzhuo
  • 158字
  • 2021-06-24 15:17:29

TensorBoard

TensorBoard is TensorFlow's visualization tool that can be used to visualize the computational graph. It can also be used to plot various quantitative metrics and the results of several intermediate calculations. Using TensorBoard, we can easily visualize complex models, which will be useful for debugging and also sharing.

Now, let's build a basic computation graph and visualize that in TensorBoard.

First, let's import the library:

import tensorflow as tf

Next, we initialize the variables:

a = tf.constant(5)
b = tf.constant(4)
c = tf.multiply(a,b)
d = tf.constant(2)
e = tf.constant(3)
f = tf.multiply(d,e)
g = tf.add(c,f)

Now, we will create a TensorFlow session. We will write the results of our graph to a file called event using tf.summary.FileWriter():

with tf.Session() as sess:
writer = tf.summary.FileWriter("output", sess.graph)
print(sess.run(g))
writer.close()

In order to run the TensorBoard, go to your Terminal, locate the working directory, and type tensorboard --logdir=output --port=6003.

You can see the output as shown next:

主站蜘蛛池模板: 邵阳县| 濮阳县| 乐陵市| 陵水| 内丘县| 日照市| 巩义市| 池州市| 乐安县| 开江县| 黄梅县| 建平县| 革吉县| 福清市| 岗巴县| 南和县| 上蔡县| 舒兰市| 江北区| 乌鲁木齐市| 拉孜县| 肥城市| 大英县| 共和县| 新兴县| 始兴县| 博兴县| 阿拉善左旗| 云南省| 安多县| 嘉荫县| 花莲市| 乌苏市| 陆川县| 临漳县| 宜昌市| 朝阳县| 嘉黎县| 通化市| 马山县| 青川县|