Pytorch implementation of Forward Thinking: Building and Training Neural Networks One Layer at a Time
- Python 2.7
- numpy
- pytorch
- Matplotlib
$ ./run.sh
to run forward-thinking & forward-thinking (deep) & backpropagation & backpropagation (deep).
For forward-thinking experiment (5 layers),
$ python forward_thinking.py
If you want to do this with very deep model (20 layers),
$ python forward_thinking.py --epoch 200 --deep
As a comparison, learn by backpropagation:
$ python backpropagate.py
Backpropagate with very deep model (20 layers),
$ python backpropagate.py --epoch 200 --deep
For 5 layers, forward-thinking learns slightly faster than backpropagation. Dips are observed when new layers are added.
When the model becomes very deep (20 layers), backpropagation cannot train the model. On the other hand, forward-thinking can train the model as usual.