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

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:

主站蜘蛛池模板: 洛隆县| 专栏| 彭山县| 东源县| 静海县| 新乐市| 阿拉善右旗| 漾濞| 上虞市| 太谷县| 平凉市| 大关县| 常宁市| 灵山县| 华容县| 金门县| 泌阳县| 玉山县| 辽阳县| 定结县| 汝州市| 临城县| 丰原市| 奉节县| 洪泽县| 德昌县| 孝义市| 安仁县| 疏附县| 忻城县| 唐河县| 建水县| 安平县| 泰来县| 团风县| 沅陵县| 醴陵市| 志丹县| 博湖县| 吐鲁番市| 德惠市|