![Artificial Intelligence By Example](https://wfqqreader-1252317822.image.myqcloud.com/cover/832/36699832/b_36699832.jpg)
上QQ阅读APP看书,第一时间看更新
The architecture of Python TensorFlow
Implementation of the McCulloch-Pitts neuron can best be viewed with TensorBoard, as shown in the following graph:
![](https://epubservercos.yuewen.com/E3E207/19470393001563506/epubprivate/OEBPS/Images/Chapter_225.jpg?sign=1738899897-MNhPCg6rsN7roSUXsd40zkGwKk92EAsC-0-9dd94b72e0d50259a7a9e10a1c83a80c)
This is obtained by adding the following TensorBoard code at the end of your session. This data flow graph will help optimize a program when things go wrong.
#___________Tensorboard________________________
#with tf.Session() as sess:
Writer = tf.summary.FileWriter("directory on your machine", tfs.graph)
Writer.close()
def launchTensorBoard():
import os
#os.system('tensorboard --logdir=' + 'your directory')
os.system('tensorboard --logdir=' + 'your directory')
return
import threading
t = threading.Thread(target=launchTensorBoard, args=([]))
t.start()
tfs.close()
#Open your browser and go to http://localhost:6006
#Try the various options. It is a very useful tool.
#close the system window when your finished.
When you open the URL indicated in the code on your machine, you will see the following TensorBoard data flow graph:
![](https://epubservercos.yuewen.com/E3E207/19470393001563506/epubprivate/OEBPS/Images/Chapter_185.jpg?sign=1738899897-Ed0o6rYrYJw2RiNIf3oSczICVklpMYZ9-0-0145a58cb278a2259ff46be8a732bc2a)