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

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:

主站蜘蛛池模板: 文水县| 碌曲县| 黄骅市| 高要市| 平果县| 全州县| 韶山市| 茌平县| 湖州市| 应用必备| 肃宁县| 乐至县| 庐江县| 富顺县| 中超| 盐津县| 江山市| 沽源县| 稻城县| 磐安县| 肇庆市| 贵阳市| 杭锦后旗| 武功县| 江门市| 虎林市| 固镇县| 乳源| 新建县| 北宁市| 舞阳县| 南召县| 弋阳县| 贺州市| 邵阳县| 沁阳市| 甘洛县| 广东省| 罗定市| 应城市| 临武县|