No project description provided
Project description
Implementation of https://arxiv.org/abs/1904.00962 for large batch, large learning rate training.
Bonus: TensorboardX logging (example below).
Try the sample
git clone git@github.com:cybertronai/pytorch-lamb.git
cd pytorch-lamb
pip install -e .
python test_lamb.py
tensorboard --logdir=runs
Sample results
At --lr=.1
, the Adam optimizer is unable to train. With a little weight decay, LAMB avoids diverging!
Green: python test_lamb.py --batch-size=512 --lr=.1 --wd=0 --log-interval=30 --optimizer=lamb
Blue: python test_lamb.py --batch-size=512 --lr=.1 --wd=.01 --log-interval=30 --optimizer=lamb
r1
is the L2 norm of the weights. You can see in the green plot that some of the weights start to run away, which leads to divergence. This is why weight decay helps.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytorch_lamb-0.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b361b2b2c76248e02d3e277e4b35505222482e2f11cc143540d2c48d33924ff |
|
MD5 | 4243bf7aba13ac795889ca3b41d47397 |
|
BLAKE2b-256 | 397d79c329e8e3939b545938720ca1fa6124f96d4e1394566cdbcadcb91628f3 |