Skip to content

Commit

Permalink
Docs: Update preprocess docs (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
syt123450 committed Apr 4, 2019
1 parent b21298e commit 5e530cf
Show file tree
Hide file tree
Showing 200 changed files with 3,039 additions and 4,040 deletions.
16 changes: 8 additions & 8 deletions docs/preprocess/README.md → docs/README.md
@@ -1,4 +1,5 @@
## Introduction: Model Preprocessing
<h1 align=center>Introduction: Model Preprocessing</h1>

It is confusing for the new TensorSpace developer to preprocess the pre-trained models: "What is a model preprocessing?", "Why do we need to preprocess the model?" and " How can we make it?". Then this introduction should somehow help you to understand the preprocessing.

**What is a model preprocessing?**<br/>
Expand All @@ -10,7 +11,7 @@ A model preprocessing for TensorSpace is the process to detect necessary data (i
Typically, the trained model consumes the input data from the users and then computes among different layers/tensors and finally returns the meaningful outputs which can be used for further evaluations.

<p align="center">
<img width=800 src="./img/intro_preprocess_s.png">
<img width=800 src="./assets/img/intro_preprocess_s.png">
</p>
<p align="center">
<b>Fig. 1</b> - Classic pre-trained model with single output
Expand All @@ -23,17 +24,16 @@ However, the beauties of TensorSpace as a 3D data visualization model are not on
Hence, we need to find a way to collect the intermediate outputs from not only the last few output layers, but also from the intermediate hidden layers.

<p align="center">
<img width=800 src="./img/intro_preprocess_m.png">
<img width=800 src="./assets/img/intro_preprocess_m.png">
</p>
<p align="center">
<b>Fig. 2</b> - TensorSpace compatible model with intermediate outputs
</p>


**How do we preprocess a model?**<br/>
To fully apply the core functionality of TensorSpace, we need to transfer the classic model (only returns the final output) into a new model (generates all intermediate outputs we want to present). For the following sections, we introduce how to preprocess the models built by TensorFlow, Keras, tf.Keras and TensorFlow.js.
To fully apply the core functionality of TensorSpace, we need to transfer the classic model (only returns the final output) into a new model (generates all intermediate outputs we want to present). For the following sections, we introduce how to use TensorFlow-Converter to preprocess and use TensorSpace to visualize the preprocessed models built by TensorFlow, Keras, and TensorFlow.js.

* [TensorFlow model preprocessing tutorial](https://github.com/tensorspace-team/tensorspace/tree/master/docs/preprocess/TensorFlow/README.md)
* [Keras model preprocessing tutorial](https://github.com/tensorspace-team/tensorspace/tree/master/docs/preprocess/Keras/README.md)
* [tf.keras model preprocessing tutorial](https://github.com/tensorspace-team/tensorspace/tree/master/docs/preprocess/tfKeras/README.md)
* [TensorFlow.js model preprocessing tutorial](https://github.com/tensorspace-team/tensorspace/tree/master/docs/preprocess/TensorFlowJS/README.md)
* [TensorFlow tutorial](https://github.com/tensorspace-team/tensorspace-converter/tree/master/examples/tensorflow)
* [Keras tutorial](https://github.com/tensorspace-team/tensorspace-converter/tree/master/examples/keras)
* [TensorFlow.js tutorial](https://github.com/tensorspace-team/tensorspace-converter/tree/master/examples/tfjs)
15 changes: 7 additions & 8 deletions docs/preprocess_zh/README.md → docs/README_zh.md
@@ -1,4 +1,4 @@
# 模型预处理简介
<h1 align=center>模型预处理简介</h1>

“什么是模型预处理?”、“我们为什么要模型预处理?”、“我们该怎么模型预处理?”本篇模型预处理简介将解答这些问题。

Expand All @@ -19,7 +19,7 @@
例如,一个MNIST手写字符模型,常见的预训练模型(Tensorflow或Keras)只有一个最终输出,即经过最后softmax层的输出值(10个0-1之间的一个数,表示`0-9`数字的可能概率),如下图所示

<p align="center">
<img width=800 src="./img/intro_preprocess_s_zh.png">
<img width=800 src="./assets/img/intro_preprocess_s_zh.png">
</p>
<p align="center">
<b>图1</b> - 传统情形下的单一输出
Expand All @@ -30,7 +30,7 @@
为了达成这个效果,相对于图1,需要对模型进行预处理,使得可以从网上下载得到的预训练模型不仅仅输出最终结果,还会输出层间结果,而本教程就是为了说明如何定位层间节点的位置,如果生成多输出(层间输出)预训练模型,如下图所示

<p align="center">
<img width=800 src="./img/intro_preprocess_m_zh.png">
<img width=800 src="./assets/img/intro_preprocess_m_zh.png">
</p>
<p align="center">
<b>图2</b> - 拥有中间层输出的TensorSpace适配模型
Expand All @@ -40,9 +40,8 @@

通过预处理,将传统单一输出的神经网络模型转换为拥有中间层输出的`TensorSpace`适配模型。

基于不同的神经网络构造框架,细分了不同的预处理教程。
基于不同的神经网络构造框架,细分了不同的预处理教程。教程介绍了如何使用 TensorSpace-Converter 来对模型进行预处理,然后使用 TensorSpace 来对经过预处理的模型可视化。

* [TensorFlow 模型预处理](https://github.com/tensorspace-team/tensorspace/blob/master/docs/preprocess_zh/TensorFlow/README.md)
* [Keras 模型预处理](https://github.com/tensorspace-team/tensorspace/blob/master/docs/preprocess_zh/Keras/README.md)
* [tf.keras 模型预处理](https://github.com/tensorspace-team/tensorspace/blob/master/docs/preprocess_zh/tfKeras/README.md)
* [TensorFlow.js 模型预处理](https://github.com/tensorspace-team/tensorspace/blob/master/docs/preprocess_zh/TensorFlowJS/README.md)
* [TensorFlow 教程](https://github.com/tensorspace-team/tensorspace-converter/blob/master/examples/tensorflow/README_zh.md)
* [Keras 教程](https://github.com/tensorspace-team/tensorspace-converter/blob/master/examples/keras/README_zh.md)
* [TensorFlow.js 教程](https://github.com/tensorspace-team/tensorspace-converter/blob/master/examples/tfjs/README_zh.md)
1 change: 1 addition & 0 deletions docs/assets/data/5.json
@@ -0,0 +1 @@
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.019607843831181526,0.027450980618596077,0.027450980618596077,0.027450980618596077,0.40784314274787903,0.5098039507865906,0.5098039507865906,0.6901960968971252,1,0.7960784435272217,0.5098039507865906,0.0470588244497776,0.003921568859368563,0,0,0,0,0,0,0,0,0,0,0.003921568859368563,0.09803921729326248,0.5333333611488342,0.5333333611488342,0.5333333611488342,0.8509804010391235,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9764705896377563,0.9450980424880981,0.9450980424880981,0.4941176474094391,0.4588235318660736,0.0117647061124444,0,0,0,0,0,0,0,0,0,0,0.07058823853731155,0.9647058844566345,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9411764740943909,0.9215686321258545,0.9215686321258545,0.5490196347236633,0.8156862854957581,0.9215686321258545,0.5137255191802979,0.27843138575553894,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.007843137718737125,0.38823530077934265,0.9921568632125854,0.6196078658103943,0.4117647111415863,0.12941177189350128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.13333334028720856,0.9921568632125854,0.9921568632125854,0.364705890417099,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.10588235408067703,0.8352941274642944,0.9921568632125854,0.6039215922355652,0.13333334028720856,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.5333333611488342,0.9921568632125854,0.9921568632125854,0.4901960790157318,0.1725490242242813,0.1725490242242813,0.13725490868091583,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.4431372582912445,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9333333373069763,0.572549045085907,0.14901961386203766,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.01568627543747425,0.5607843399047852,0.9019607901573181,0.9647058844566345,0.8078431487083435,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9215686321258545,0.33725491166114807,0.05098039284348488,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.1568627506494522,0.23137255012989044,0.03921568766236305,0.2666666805744171,0.2666666805744171,0.6627451181411743,0.9921568632125854,0.9921568632125854,0.6431372761726379,0.0470588244497776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.054901961237192154,0.3607843220233917,0.929411768913269,0.9921568632125854,0.6431372761726379,0.0470588244497776,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.5333333611488342,0.929411768913269,0.9921568632125854,0.30980393290519714,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.38823530077934265,0.9921568632125854,0.929411768913269,0.2705882489681244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.19607843458652496,0.929411768913269,0.9921568632125854,0.6274510025978088,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.38823530077934265,0.9921568632125854,0.9411764740943909,0.10196078568696976,0,0,0,0,0,0,0,0,0,0,0,0,0.0117647061124444,0.6509804129600525,0.8117647171020508,0,0,0,0,0,0,0,0,0,0.3176470696926117,0.9921568632125854,0.9921568632125854,0.11764705926179886,0,0,0,0,0,0,0,0,0,0,0,0,0.027450980618596077,0.9921568632125854,0.9490196108818054,0.4156862795352936,0.4156862795352936,0.35686275362968445,0,0,0,0,0,0,0.3176470696926117,0.9921568632125854,0.9921568632125854,0.11764705926179886,0,0,0,0,0,0,0,0,0,0,0,0,0.01568627543747425,0.7921568751335144,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9843137264251709,0.9254902005195618,0.9254902005195618,0.9254902005195618,0.9254902005195618,0.9254902005195618,0.9254902005195618,0.9450980424880981,0.9921568632125854,0.6509804129600525,0.0117647061124444,0,0,0,0,0,0,0,0,0,0,0,0,0,0.05098039284348488,0.5647059082984924,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.40392157435417175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.003921568859368563,0.019607843831181526,0.019607843831181526,0.3333333432674408,0.5058823823928833,0.6000000238418579,0.9921568632125854,0.9921568632125854,0.9921568632125854,0.8509804010391235,0.5058823823928833,0.34117648005485535,0.003921568859368563,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 5e530cf

Please sign in to comment.