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

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:

主站蜘蛛池模板: 星座| 安多县| 滨海县| 惠东县| 正蓝旗| 车险| 河池市| 揭阳市| 松溪县| 昌江| 夏津县| 海伦市| 监利县| 株洲县| 司法| 涞水县| 江津市| 随州市| 皮山县| 苍梧县| 普定县| 白银市| 安庆市| 宣城市| 利辛县| 苍梧县| 桂东县| 宁河县| 绥江县| 河南省| 兴化市| 尼勒克县| 保康县| 衡山县| 嘉兴市| 沅江市| 太和县| 札达县| 嘉义市| 徐水县| 柘城县|