提交 c22211e7 编写于 作者: D daminglu 提交者: GitHub

Merge pull request #17 from PaddlePaddle/update_data_format_design

Update data format design
## VisualDL Graph Data Format Design
## Background
Neural network has a concept of `Model`. VisualDL has a very important feature that it can visualize the structure of deep learning `Model`. As a visualization tool that wants to support many different deep learning frameworks, we should use a generic Model data format that is supported by most of the frameworks.
Neural network has a concept called `Model`. VisualDL has an important feature that can visualize the structure of a deep learning `Model`. As a visualization tool, it tries to support various deep learning frameworks. It uses a generic `Model` data format that is supported by most of the frameworks.
Facebook open-sourced an [ONNX](http://onnx.ai/)(Open Neural Network Exchange). ONNX is an open format to represent deep learning models. It now officially supported by world's most popular framework like Tensorflow, Caffe2, MxNet, PaddlePaddle Fluid, so we decided to choose ONNX as the standard Model format and support the visualization of ONNX model.
Facebook has an open-source project called [ONNX](http://onnx.ai/)(Open Neural Network Exchange). ONNX is an open format that represents deep learning models. It is now officially supported by most popular frameworks such as Tensorflow, Caffe2, MxNet, PaddlePaddle Fluid, etc. So we decided to choose ONNX as the standard Model format and support the visualization of ONNX model.
## IR of ONNX
The description of ONNX IR can be found [here](https://github.com/onnx/onnx/blob/master/docs/IR.md). The most important part is the definition of [Graph](https://github.com/onnx/onnx/blob/master/docs/IR.md#graphs).
Each computation data flow graph is structured as a list of nodes that form a graph. Each node is a call to an operator. Nodes have zero or more inputs, one or more outputs, and zero or more attribute-value pairs.
Each computation data flow graph is structured as a list of nodes that form the graph. Each node is called an operator. Nodes have zero or more inputs, one or more outputs, and zero or more attribute-value pairs.
## Rest API data format
Frontend use rest API to get data from the server, the data format will be JSON, the data structure of a Graph is as below. Each Graph will have three vectors inside:
Frontend uses rest API to get data from the server. The data format will be JSON. The data structure of a Graph is as below. Each Graph has three vectors:
- `node` represent Operator. It has type, input, and output.
- `input` represent input data or parameters, it has shape info.
- `output` represent output data of the graph, it has shape info.
- `node` represents Operator. It has type, input, and output.
- `input` represents input data or parameters, it has shape info.
- `output` represents output data of the graph, it has shape info.
```json
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册