提交 04faec7b 编写于 作者: L likesiwell

fix reamde

上级 4862c7b0
...@@ -109,7 +109,7 @@ def mlp_student(img, drop_prob, h_size): ...@@ -109,7 +109,7 @@ def mlp_student(img, drop_prob, h_size):
| StudentNet 30units with 4.0temp soft targets | 97.01% | | StudentNet 30units with 4.0temp soft targets | 97.01% |
训练过程中的测试集准确率如下图所示,可以看到使用soft targets训练的小网络的收敛速度快于不使用soft targets的网络。 训练过程中的测试集准确率如下图所示,可以看到使用soft targets训练的小网络的收敛速度快于不使用soft targets的网络。
![收敛](https://github.com/likesiwell/models/blob/develop/distill_knowledge/images/plots.png) ![收敛](https://github.com/likesiwell/models/blob/distill-branch/distill_knowledge/images/plots.png)
## 参考文献 ## 参考文献
......
...@@ -110,7 +110,7 @@ When we train the small network with soft targets of temperature 4.0, we get the ...@@ -110,7 +110,7 @@ When we train the small network with soft targets of temperature 4.0, we get the
| StudentNet 30units with 4.0temp soft targets | 97.01% | | StudentNet 30units with 4.0temp soft targets | 97.01% |
The testing accuracy during training procedure are visualized here. We can see that using soft targets speed up the convergence. The testing accuracy during training procedure are visualized here. We can see that using soft targets speed up the convergence.
![convergence](https://github.com/likesiwell/models/blob/develop/distill_knowledge/images/plots.png) ![convergence](https://github.com/likesiwell/models/blob/distill-branch/distill_knowledge/images/plots.png)
......
import paddle import paddle
import numpy as np import numpy as np
import os
reader = paddle.dataset.mnist.train() reader = paddle.dataset.mnist.train()
img_list = [] img_list = []
label_list = [] label_list = []
...@@ -23,6 +24,11 @@ test_x = np.vstack(img_list) ...@@ -23,6 +24,11 @@ test_x = np.vstack(img_list)
test_y = np.vstack(label_list) test_y = np.vstack(label_list)
print(test_x.shape, test_y.shape) print(test_x.shape, test_y.shape)
if not os.path.exits('./data/'):
os.makedirs('./data/')
if not os.path.exits('./models/'):
os.makedirs('./models')
np.savez( np.savez(
'./data/mnist.npz', './data/mnist.npz',
train_x=train_x, train_x=train_x,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册