- Hands-On Reinforcement Learning with Python
- Sudharsan Ravichandiran
- 158字
- 2021-06-18 19:12:08
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:

- 大學(xué)計(jì)算機(jī)應(yīng)用基礎(chǔ)實(shí)踐教程
- 數(shù)據(jù)結(jié)構(gòu)(Python語言描述)(第2版)
- 深入理解Java7:核心技術(shù)與最佳實(shí)踐
- 軟件項(xiàng)目管理實(shí)用教程
- Java程序設(shè)計(jì):原理與范例
- Mastering Apache Maven 3
- Hands-On Reinforcement Learning with Python
- Visual Basic程序設(shè)計(jì)實(shí)踐教程
- Visual Basic程序設(shè)計(jì)
- Python全棧數(shù)據(jù)工程師養(yǎng)成攻略(視頻講解版)
- 深入剖析Java虛擬機(jī):源碼剖析與實(shí)例詳解(基礎(chǔ)卷)
- ArcGIS for Desktop Cookbook
- Go語言底層原理剖析
- RubyMotion iOS Develoment Essentials
- Xamarin Blueprints