Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytorch-lamb, version 0.0.0
Filename, size File type Python version Upload date Hashes
Filename, size pytorch_lamb-0.0.0-py3-none-any.whl (4.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pytorch_lamb-0.0.0.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page