Skip to content

Commit 53e4a72

Browse files
committed
add meSimp; refactor
1 parent f1803e1 commit 53e4a72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4135
-2863
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,4 +306,7 @@ OpenCover/
306306

307307

308308
# vscode
309-
.vscode/
309+
.vscode/
310+
311+
data/*
312+
logs/*

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
# meProp
1+
# meProp & meSimp
22

33
The codes were used for experiments on MNIST with _meProp: Sparsified Back Propagation for Accelerated Deep Learning with Reduced Overfitting_ (ICML 2017) [[pdf]](http://proceedings.mlr.press/v70/sun17c/sun17c.pdf) by Xu Sun, Xuancheng Ren, Shuming Ma, Houfeng Wang. Both the codes for CPU and GPU were included.
44

5+
**Update**:
6+
- The codes used for experiments on MNIST with _Training Simplification and Model Simplification for Deep Learning: A Minimal Effort Back Propagation Method_ [[pdf]](https://arxiv.org/pdf/1711.06528) by Xu Sun, Xuancheng Ren, Shuming Ma, Bingzhen Wei, Wei Li, Houfeng Wang, are now included.
7+
- We have reworked the codes, and the documents are currently being updated. Please refer to the README in src for a brief introduction to the codes.
8+
59
We propose a simple yet effective technique for neural network learning, which we call **meProp** (*m*inimal *e*ffort back *prop*agation). The forward propagation is computed as usual. In back propagation, only a small subset of the full gradient is computed to update the model parameters. The gradient vectors are sparsified in such a way that **only the top-k elements (in terms of magnitude) are kept**. As a result, only *k* rows or columns (depending on the layout) of the weight matrix are modified, leading to a linear reduction (*k* divided by the vector dimension) in the computational cost. Surprisingly, experimental results demonstrate that we can **update only 1–4% of the weights** at each back propagation pass. This does not result in a larger number of training iterations. More interestingly, the proposed method **improves the accuracy of the resulting models** rather than degrades the accuracy, and a detailed analysis is given in the paper.
610

711
![An illustration of the idea of meProp.](./docs/illustration.svg)
@@ -36,7 +40,8 @@ bibtex:
3640
pages = {3299--3308},
3741
year = {2017},
3842
volume = {70},
39-
series = {Proceedings of Machine Learning Research}
43+
series = {Proceedings of Machine Learning Research},
44+
address = {International Convention Centre, Sydney, Australia}
4045
}
4146
```
4247

@@ -77,9 +82,9 @@ or
7782
```
7883
mono nnmnist.exe <config.json>
7984
```
80-
where <config.json> is a configuration file. There is [an example configuration file](./meprop%20(CSharp)/nnmnist/default.json) in the source codes. The output will be written to a file at the same location with the executable. The code supports random _k_ selection in addition.
85+
where <config.json> is a configuration file. There is [an example configuration file](./src/csharp/nnmnist/default.json) in the source codes. The output will be written to a file at the same location with the executable. The code supports random _k_ selection in addition.
8186
### PyTorch
8287
```bash
83-
python3.5 meprop (PyTorch).py
88+
python3.5 main.py
8489
```
8590
The results will be written to stdout by default, but you can change the argument _file_ when initializing the _TestGroup_ to write the results to a file. The code supports simple unified meProp in addition. Please notice, this code will use GPU by default.

meprop (CSharp)/nnmnist/Application/Mnist.cs

Lines changed: 0 additions & 197 deletions
This file was deleted.

meprop (CSharp)/nnmnist/Common/RandomUtil.cs

Lines changed: 0 additions & 67 deletions
This file was deleted.

meprop (CSharp)/nnmnist/Common/Timer.cs

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)