Tensorflow 简明教程

TensorFlow - TensorBoard Visualization

TensorFlow 包含一个名为 TensorBoard 的可视化工具。它用于分析数据流程图,还用于了解机器学习模型。TensorBoard 的重要功能包括从垂直方向上查看关于参数和任何图表的详细信息的不同类型的统计信息。

TensorFlow includes a visualization tool, which is called the TensorBoard. It is used for analyzing Data Flow Graph and also used to understand machine-learning models. The important feature of TensorBoard includes a view of different types of statistics about the parameters and details of any graph in vertical alignment.

深度神经网络包括多达 36000 个节点。TensorBoard 帮助以高级块折叠这些节点并突出显示相同结构。这将允许对图进行更好的分析,重点关注计算图的主要部分。TensorBoard 可视化被认为是极具交互性的,用户可以在其中平移、缩放和展开节点以显示详细信息。

Deep neural network includes up to 36,000 nodes. TensorBoard helps in collapsing these nodes in high-level blocks and highlighting the identical structures. This allows better analysis of graph focusing on the primary sections of the computation graph. The TensorBoard visualization is said to be very interactive where a user can pan, zoom and expand the nodes to display the details.

以下示意图表示展示了 TensorBoard 可视化的完整工作原理 −

The following schematic diagram representation shows the complete working of TensorBoard visualization −

tensorboard visualization

该算法将节点折叠成高级块并突出显示特定组,其中包含相同结构,从而分离出高阶节点。这样创建的 TensorBoard 是有用的,并且被认为与调整机器学习模型同样重要。此可视化工具旨在用于包含汇总信息和需要显示的详细信息的配置日志文件。

The algorithms collapse nodes into high-level blocks and highlight the specific groups with identical structures, which separate high-degree nodes. The TensorBoard thus created is useful and is treated equally important for tuning a machine learning model. This visualization tool is designed for the configuration log file with summary information and details that need to be displayed.

让我们借助以下代码重点关注 TensorBoard 可视化演示示例 −

Let us focus on the demo example of TensorBoard visualization with the help of the following code −

import tensorflow as tf

# Constants creation for TensorBoard visualization
a = tf.constant(10,name = "a")
b = tf.constant(90,name = "b")
y = tf.Variable(a+b*2,name = 'y')
model = tf.initialize_all_variables() #Creation of model

with tf.Session() as session:
   merged = tf.merge_all_summaries()
   writer = tf.train.SummaryWriter("/tmp/tensorflowlogs",session.graph)
   session.run(model)
   print(session.run(y))

下表显示了用于节点表示的 TensorBoard 可视化的各种符号 −

The following table shows the various symbols of TensorBoard visualization used for the node representation −

node representation