diff --git a/tutorials/source_en/advanced_use/dashboard_and_lineage.md b/tutorials/source_en/advanced_use/dashboard_and_lineage.md index d2fe077e69e3686ff5576bfdc77a522ad1810aaf..39a373a9eb3b76521d05a2e3ba4cc3550bcbdb25 100644 --- a/tutorials/source_en/advanced_use/dashboard_and_lineage.md +++ b/tutorials/source_en/advanced_use/dashboard_and_lineage.md @@ -15,6 +15,7 @@ - [Computational Graph Visualization](#computational-graph-visualization) - [Dataset Graph Visualization](#dataset-graph-visualization) - [Image Visualization](#image-visualization) + - [Tensor Visualization](#tensor-visualization) - [Model Lineage](#model-lineage) - [Dataset Lineage](#dataset-lineage) - [Scalars Comparision](#scalars-comparision) @@ -316,6 +317,19 @@ In the saved files, `ms_output_after_hwopt.pb` is the computational graph after summary_collector = SummaryCollecotor('./summary_dir2') model.train(epoch=2, train_dataset, callbacks=[confusion_callback, summary_collector]) ``` +4. Since tensor visualizatioin (`TensorSummary`) records raw tensor data, it requires a large amount of storage space. Before using `TensorSummary` and during training, please check that the system storage space is sufficient. + The storage space occupied by the tensor visualizatioin function can be reduced by the following methods: + 1) Avoid using `TensorSummary` to record larger tensor. + + 2) Reduce the number of `TensorSummary` operators in the network. + + After using the function, please clean up the training logs that are no longer needed in time to free up disk space. + + Remarks: The method of estimating the space usage of `TensorSummary` is as follows: + + The size of a `TensorSummary` data = the number of values in the tensor * 4 bytes. Assuming that the size of the tensor recorded by `TensorSummary` is 32*1*256*256, then a `TensorSummary` data needs about 32*1*256*256*4 bytes = 8,388,608 bytes = 8MiB. + Also suppose that the collect_freq of `SummaryCollector` is set to 1, and 50 iterations are trained. Then the required space when recording these 50 sets of data is about 50*8 MiB = 400MiB. + It should be noted that due to the overhead of data structure and other factors, the actual storage space used will be slightly larger than 400MiB. ## Visualization Components @@ -396,11 +410,11 @@ Figure 7: Computational graph function area Figure 7 shows the function area of the computational graph, including: -* File selection box: View the computational graphs of different files. -* Search box: Enter a node name and press Enter to view the node. -* Thumbnail: Display the thumbnail of the entire network structure. When viewing an extra large image structure, you can view the currently browsed area. -* Node information: Display the basic information of the selected node, including the node name, properties, input node, and output node. -* Legend: Display the meaning of each icon in the computational graph. +- File selection box: View the computational graphs of different files. +- Search box: Enter a node name and press Enter to view the node. +- Thumbnail: Display the thumbnail of the entire network structure. When viewing an extra large image structure, you can view the currently browsed area. +- Node information: Display the basic information of the selected node, including the node name, properties, input node, and output node. +- Legend: Display the meaning of each icon in the computational graph. #### Dataset Graph Visualization @@ -412,9 +426,9 @@ Figure 8: Dataset graph function area Figure 8 shows the dataset graph function area which includes the following content: -* Legend: Display the meaning of each icon in the data lineage graph. -* Data Processing Pipeline: Display the data processing pipeline used for training. Select a single node in the graph to view details. -* Node Information: Display basic information about the selected node, including names and parameters of the data processing and augmentation operators. +- Legend: Display the meaning of each icon in the data lineage graph. +- Data Processing Pipeline: Display the data processing pipeline used for training. Select a single node in the graph to view details. +- Node Information: Display basic information about the selected node, including names and parameters of the data processing and augmentation operators. #### Image Visualization @@ -436,27 +450,59 @@ Figure 10 shows the function area of image visualization. You can view image inf - Brightness Adjustment: Adjust the brightness of all displayed images. - Contrast Adjustment: Adjust the contrast of all displayed images. +#### Tensor Visualization + +Tensor visualization is used to display tensors in the form of table and histogram. + +![tensor_function.png](./images/tensor_function.png) + +Figure 11: Tensor visualization function area + +Figure 11 shows the function area of tensor visualization. + +- Tag selection: Select the required tags to view the corresponding table data or histogram. +- View: Select `Table` or `Histogram` to display tensor data. In the `Histogram` view, there are the options of `Vertical axis` and `Angle of view`. +- Vertical axis: Select any of `Step`, `Relative time`, and `Absolute time` as the data displayed on the vertical axis of the histogram. +- Angle of view: Select either `Front` or `Top`. `Front` view refers to viewing the histogram from the front view. In this case, data between different steps is overlapped. `Top` view refers to viewing the histogram at an angle of 45 degrees. In this case, data between different steps can be presented. + +![tensor_table.png](./images/tensor_table.png) + +Figure 12: Table display + +Figure 12 shows tensors recorded by a user in a form of a table which includes the following function: + +- Click the small square button on the right side of the table to zoom in the table. +- The white box in the table shows the tensor data under which dimension is currently displayed, where the colon `:` represents all values of the current dimension, you can enter the corresponding index or `:` in the box and press `Enter` or click the button of tick on the back to query tensor data for specific dimensions. + Assuming a certain dimension is 32, the index range is -32 to 31. Note: tensor data from 0 to 2 dimensions can be queried. Tensor data of more than two dimensions is not supported, in other word, the query conditions of more than two colons `:` cannot be set. +- Query the tensor data of a specific step by dragging the hollow circle below the table. + +![tensor_histogram.png](./images/tensor_histogram.png) + +Figure 13: Histogram display + +Figure 13 shows tensors recorded by a user in a form of a histogram. Click the upper right corner to zoom in the histogram. + ### Model Lineage Model lineage visualization is used to display the parameter information of all training models. ![image.png](./images/lineage_label.png) -Figure 11: Model parameter selection area +Figure 14: Model parameter selection area -Figure 11 shows the model parameter selection area, which lists the model parameter tags that can be viewed. You can select required tags to view the corresponding model parameters. +Figure 14 shows the model parameter selection area, which lists the model parameter tags that can be viewed. You can select required tags to view the corresponding model parameters. ![image.png](./images/lineage_model_chart.png) -Figure 12: Model lineage function area +Figure 15: Model lineage function area -Figure 12 shows the model lineage function area, which visualizes the model parameter information. You can select a specific area in the column to display the model information within the area. +Figure 15 shows the model lineage function area, which visualizes the model parameter information. You can select a specific area in the column to display the model information within the area. ![image.png](./images/lineage_model_table.png) -Figure 13: Model list +Figure 16: Model list -Figure 13 shows all model information in groups. You can sort the model information in ascending or descending order by specified column. +Figure 16 shows all model information in groups. You can sort the model information in ascending or descending order by specified column. ### Dataset Lineage @@ -464,21 +510,21 @@ Dataset lineage visualization is used to display data processing and augmentatio ![data_label.png](./images/data_label.png) -Figure 14: Data processing and augmentation operator selection area +Figure 17: Data processing and augmentation operator selection area -Figure 14 shows the data processing and augmentation operator selection area, which lists names of data processing and augmentation operators that can be viewed. You can select required tags to view related parameters. +Figure 17 shows the data processing and augmentation operator selection area, which lists names of data processing and augmentation operators that can be viewed. You can select required tags to view related parameters. ![data_chart.png](./images/data_chart.png) -Figure 15: Dataset lineage function area +Figure 18: Dataset lineage function area -Figure 15 shows the dataset lineage function area, which visualizes the parameter information used for data processing and augmentation. You can select a specific area in the column to display the parameter information within the area. +Figure 18 shows the dataset lineage function area, which visualizes the parameter information used for data processing and augmentation. You can select a specific area in the column to display the parameter information within the area. ![data_table.png](./images/data_table.png) -Figure 16: Dataset lineage list +Figure 19: Dataset lineage list -Figure 16 shows the data processing and augmentation information of all model trainings. +Figure 19 shows the data processing and augmentation information of all model trainings. > If user filters the model lineage and then switches to the data lineage page, the line chart will show the latest filtered column in model lineage. @@ -488,9 +534,9 @@ Scalars Comparision can be used to compare scalar curves between multiple traini ![multi_scalars.png](./images/multi_scalars.png) -Figure 17: Scalars comparision curve area +Figure 20: Scalars comparision curve area -Figure 17 shows the scalar curve comparision between multiple trainings. The horizontal coordinate indicates the training step, and the vertical coordinate indicates the scalar value. +Figure 20 shows the scalar curve comparision between multiple trainings. The horizontal coordinate indicates the training step, and the vertical coordinate indicates the scalar value. Buttons from left to right in the upper right corner of the figure are used to display the chart in full screen, switch the Y-axis scale, enable or disable the rectangle selection, roll back the chart step by step, and restore the chart. @@ -502,9 +548,9 @@ Buttons from left to right in the upper right corner of the figure are used to d ![multi_scalars_select.png](./images/multi_scalars_select.png) -Figure 18: Scalars comparision function area +Figure 21: Scalars comparision function area -Figure 18 shows the scalars comparision function area, which allows you to view scalar information by selecting different trainings or tags, different dimensions of the horizontal axis, and smoothness. +Figure 21 shows the scalars comparision function area, which allows you to view scalar information by selecting different trainings or tags, different dimensions of the horizontal axis, and smoothness. - Training: Select or filter the required trainings to view the corresponding scalar information. - Tag: Select the required tags to view the corresponding scalar information. diff --git a/tutorials/source_en/advanced_use/images/tensor_function.png b/tutorials/source_en/advanced_use/images/tensor_function.png new file mode 100644 index 0000000000000000000000000000000000000000..b6c5e8aba5b098590c168b6b5acb4c698a0f6922 Binary files /dev/null and b/tutorials/source_en/advanced_use/images/tensor_function.png differ diff --git a/tutorials/source_en/advanced_use/images/tensor_histogram.png b/tutorials/source_en/advanced_use/images/tensor_histogram.png new file mode 100644 index 0000000000000000000000000000000000000000..09b050d5462abf8dcb6d015ac3b1b38799b20cbb Binary files /dev/null and b/tutorials/source_en/advanced_use/images/tensor_histogram.png differ diff --git a/tutorials/source_en/advanced_use/images/tensor_table.png b/tutorials/source_en/advanced_use/images/tensor_table.png new file mode 100644 index 0000000000000000000000000000000000000000..35a72d0c15b68416b061a0a124a6f08a4dc477fa Binary files /dev/null and b/tutorials/source_en/advanced_use/images/tensor_table.png differ diff --git a/tutorials/source_zh_cn/advanced_use/dashboard_and_lineage.md b/tutorials/source_zh_cn/advanced_use/dashboard_and_lineage.md index a0054ad0d9482a457c3c0d0c13eb89112a45849e..44cd1a7ebf8f62fa8e24516d5917f5abf9b60d3b 100644 --- a/tutorials/source_zh_cn/advanced_use/dashboard_and_lineage.md +++ b/tutorials/source_zh_cn/advanced_use/dashboard_and_lineage.md @@ -15,6 +15,7 @@ - [计算图可视化](#计算图可视化) - [数据图可视化](#数据图可视化) - [图像可视化](#图像可视化) + - [张量可视化](#张量可视化) - [模型溯源](#模型溯源) - [数据溯源](#数据溯源) - [对比看板](#对比看板) @@ -317,6 +318,20 @@ model.train(cnn_network, callbacks=[confusion_martrix]) summary_collector = SummaryCollecotor('./summary_dir2') model.train(epoch=2, train_dataset, callbacks=[confusion_callback, summary_collector]) ``` +4. 由于张量可视(`TensorSummary`)会记录原始张量数据,需要的存储空间较大。使用`TensorSummary`前和训练过程中请注意检查系统存储空间充足。 + 通过以下方法可以降低张量可视功能的存储空间占用: + + 1)避免使用`TensorSummary`记录较大的Tensor。 + + 2)减少网络中`TensorSummary`算子的使用个数。 + + 功能使用完毕后,请及时清理不再需要的训练日志,以释放磁盘空间。 + + 备注:估算`TensorSummary`空间使用量的方法如下: + + 一个`TensorSummary`数据的大小 = Tensor中的数值个数 * 4 bytes。假设使用`TensorSummary`记录的Tensor大小为32*1*256*256,则一个`TensorSummary` + 数据大约需要32*1*256*256*4 bytes = 8,388,608 bytes = 8MiB。又假设`SummaryCollector`的collect_freq设置为1,且训练了50个迭代。则记录这50组数据 + 需要的空间约为50*8 MiB = 400MiB。需要注意的是,由于数据结构等因素的开销,实际使用的存储空间会略大于400MiB。 ## 可视化组件 @@ -397,11 +412,11 @@ model.train(cnn_network, callbacks=[confusion_martrix]) 图7展示了计算图可视化的功能区,包含以下内容: -* 文件选择框: 可以选择查看不同文件的计算图。 -* 搜索框:可以对节点进行搜索,输入节点名称点击回车,即可展示该节点。 -* 缩略图:展示整个网络图结构的缩略图,在查看超大图结构时,方便查看当前浏览的区域。 -* 节点信息:展示选中的节点的基本信息,包括节点的名称、属性、输入节点、输出节点等信息。 -* 图例:展示的是计算图中各个图标的含义。 +- 文件选择框: 可以选择查看不同文件的计算图。 +- 搜索框:可以对节点进行搜索,输入节点名称点击回车,即可展示该节点。 +- 缩略图:展示整个网络图结构的缩略图,在查看超大图结构时,方便查看当前浏览的区域。 +- 节点信息:展示选中的节点的基本信息,包括节点的名称、属性、输入节点、输出节点等信息。 +- 图例:展示的是计算图中各个图标的含义。 #### 数据图可视化 @@ -413,9 +428,9 @@ model.train(cnn_network, callbacks=[confusion_martrix]) 图8展示的数据图功能区包含以下内容: -* 图例:展示数据溯源图中各个图标的含义。 -* 数据处理流水线:展示训练所使用的数据处理流水线,可以选择图中的单个节点查看详细信息。 -* 节点信息:展示选中的节点的基本信息,包括使用的数据处理和增强算子的名称、参数等。 +- 图例:展示数据溯源图中各个图标的含义。 +- 数据处理流水线:展示训练所使用的数据处理流水线,可以选择图中的单个节点查看详细信息。 +- 节点信息:展示选中的节点的基本信息,包括使用的数据处理和增强算子的名称、参数等。 #### 图像可视化 @@ -437,27 +452,59 @@ model.train(cnn_network, callbacks=[confusion_martrix]) - 亮度调整:可以调整所展示的所有图片亮度。 - 对比度调整:可以调整所展示的所有图片对比度。 +#### 张量可视化 + +张量可视化用于将张量以表格以及直方图的形式进行展示。 + +![tensor_function.png](./images/tensor_function.png) + +图11:张量可视化功能区 + +图11展示张量可视化的功能区,包含以下内容: + +- 标签选择:提供了对所有标签进行多项选择的功能,用户可以通过勾选所需的标签,查看对应的表格数据或者直方图。 +- 视图:可以选择`表格`或者`直方图`来展示tensor数据。在`直方图`视图下存在`纵轴`和`视角`的功能选择。 +- 纵轴:可以选择`步骤`、`相对时间`、`绝对时间`中的任意一项,来作为直方图纵轴显示的数据。 +- 视角:可以选择`正视`和`俯视`中的一种。`正视`是指从正面的角度查看直方图,此时不同步骤之间的数据会覆盖在一起。`俯视`是指偏移以45度角俯视直方图区域,这时可以呈现不同步骤之间数据的差异。 + +![tensor_table.png](./images/tensor_table.png) + +图12:表格展示 + +图12将用户所记录的张量以表格的形式展示,包含以下功能: + +- 点击表格右边小方框按钮,可以将表格放大。 +- 表格中白色方框显示当前展示的是哪个维度下的张量数据,其中冒号`:`表示当前维度的所有值,可以在方框输入对应的索引或者`:`后按`Enter`键或者点击后边的打勾按钮来查询特定维度的张量数据。 + 假设某维度是32,则其索引范围是-32到31。注意:可以查询0维到2维的张量数据,不支持查询超过两维的张量数据,即不能设置超过两个冒号`:`的查询条件。 +- 拖拽表格下方的空心圆圈可以查询特定步骤的张量数据。 + +![tensor_histogram.png](./images/tensor_histogram.png) + +图13: 直方图展示 + +图13将用户所记录的张量以直方图的形式进行展示。点击图中右上角,可以将图放大。 + ### 模型溯源 模型溯源可视化用于展示所有训练的模型参数信息。 ![image.png](./images/lineage_label.png) -图11:模型参数选择区 +图14:模型参数选择区 -图11展示的模型参数选择区,列举了可供查看的模型参数标签。用户可以通过勾选所需的标签,查看相应的模型参数。 +图14展示的模型参数选择区,列举了可供查看的模型参数标签。用户可以通过勾选所需的标签,查看相应的模型参数。 ![image.png](./images/lineage_model_chart.png) -图12:模型溯源功能区 +图15:模型溯源功能区 -图12展示的模型溯源功能区,图像化展示了模型的参数信息。用户可以通过选择列的特定区域,展示区域范围内的模型信息。 +图15展示的模型溯源功能区,图像化展示了模型的参数信息。用户可以通过选择列的特定区域,展示区域范围内的模型信息。 ![image.png](./images/lineage_model_table.png) -图13:模型列表 +图16:模型列表 -图13分组展示所有模型信息,用户可以按指定列进行升序或降序展示模型信息。 +图16分组展示所有模型信息,用户可以按指定列进行升序或降序展示模型信息。 ### 数据溯源 @@ -465,21 +512,21 @@ model.train(cnn_network, callbacks=[confusion_martrix]) ![data_label.png](./images/data_label.png) -图14:数据处理和增强算子选择区 +图17:数据处理和增强算子选择区 -图14展示的数据处理和数据增强算子选择区,列举了可供查看的数据处理和增强算子的名称。用户可以通过勾选所需的标签,查看相应的参数等信息。 +图17展示的数据处理和数据增强算子选择区,列举了可供查看的数据处理和增强算子的名称。用户可以通过勾选所需的标签,查看相应的参数等信息。 ![data_chart.png](./images/data_chart.png) -图15:数据溯源功能区 +图18:数据溯源功能区 -图15展示的数据溯源功能区,图像化展示了数据处理和数据增强使用的参数信息。用户可以通过选择列的特定区域,展示区域范围内的参数信息。 +图18展示的数据溯源功能区,图像化展示了数据处理和数据增强使用的参数信息。用户可以通过选择列的特定区域,展示区域范围内的参数信息。 ![data_table.png](./images/data_table.png) -图16:数据溯源列表 +图19:数据溯源列表 -图16展示所有模型训练的数据处理和数据增强信息。 +图19展示所有模型训练的数据处理和数据增强信息。 > 如果用户筛选模型溯源随后切换到数据溯源页面时,折线图将展示最新一次筛选过的模型溯源列。 @@ -489,9 +536,9 @@ model.train(cnn_network, callbacks=[confusion_martrix]) ![multi_scalars.png](./images/multi_scalars.png) -图17: 标量对比曲线图 +图20: 标量对比曲线图 -图17展示了多个训练之间的标量曲线对比效果,横坐标是训练步骤,纵坐标是标量值。 +图20展示了多个训练之间的标量曲线对比效果,横坐标是训练步骤,纵坐标是标量值。 图中右上角有几个按钮功能,从左到右功能分别是全屏展示,切换Y轴比例,开启/关闭框选,分步回退和还原图形。 @@ -503,9 +550,9 @@ model.train(cnn_network, callbacks=[confusion_martrix]) ![multi_scalars_select.png](./images/multi_scalars_select.png) -图18:对比看板可视功能区 +图21:对比看板可视功能区 -图18展示的对比看板可视的功能区,提供了根据选择不同训练或标签,水平轴的不同维度和平滑度来进行标量对比的功能。 +图21展示的对比看板可视的功能区,提供了根据选择不同训练或标签,水平轴的不同维度和平滑度来进行标量对比的功能。 - 训练: 提供了对所有训练进行多项选择的功能,用户可以通过勾选或关键字筛选所需的训练。 - 标签:提供了对所有标签进行多项选择的功能,用户可以通过勾选所需的标签,查看对应的标量信息。 diff --git a/tutorials/source_zh_cn/advanced_use/images/tensor_function.png b/tutorials/source_zh_cn/advanced_use/images/tensor_function.png new file mode 100644 index 0000000000000000000000000000000000000000..b6c5e8aba5b098590c168b6b5acb4c698a0f6922 Binary files /dev/null and b/tutorials/source_zh_cn/advanced_use/images/tensor_function.png differ diff --git a/tutorials/source_zh_cn/advanced_use/images/tensor_histogram.png b/tutorials/source_zh_cn/advanced_use/images/tensor_histogram.png new file mode 100644 index 0000000000000000000000000000000000000000..09b050d5462abf8dcb6d015ac3b1b38799b20cbb Binary files /dev/null and b/tutorials/source_zh_cn/advanced_use/images/tensor_histogram.png differ diff --git a/tutorials/source_zh_cn/advanced_use/images/tensor_table.png b/tutorials/source_zh_cn/advanced_use/images/tensor_table.png new file mode 100644 index 0000000000000000000000000000000000000000..35a72d0c15b68416b061a0a124a6f08a4dc477fa Binary files /dev/null and b/tutorials/source_zh_cn/advanced_use/images/tensor_table.png differ