Adam-atan2 for Pytorch
Project description
Adam-atan2 - Pytorch
Implementation of the proposed Adam-atan2 optimizer in Pytorch
A multi-million dollar paper out of google deepmind proposes a small change to Adam update rule (using atan2
) to remove the epsilon altogether for numerical stability and scale invariance
It also contains some features for improving plasticity (continual learning field)
Install
$ pip install adam-atan2-pytorch
Usage
import torch
from torch import nn
# toy model
model = nn.Linear(10, 1)
# import AdamAtan2 and instantiate with parameters
from adam_atan2_pytorch import AdamAtan2
opt = AdamAtan2(model.parameters(), lr = 1e-4)
# forward and backwards
for _ in range(100):
loss = model(torch.randn(10))
loss.backward()
# optimizer step
opt.step()
opt.zero_grad()
Citations
@inproceedings{Everett2024ScalingEA,
title = {Scaling Exponents Across Parameterizations and Optimizers},
author = {Katie Everett and Lechao Xiao and Mitchell Wortsman and Alex Alemi and Roman Novak and Peter J. Liu and Izzeddin Gur and Jascha Narain Sohl-Dickstein and Leslie Pack Kaelbling and Jaehoon Lee and Jeffrey Pennington},
year = {2024},
url = {https://api.semanticscholar.org/CorpusID:271051056}
}
@inproceedings{Kumar2023MaintainingPI,
title = {Maintaining Plasticity in Continual Learning via Regenerative Regularization},
author = {Saurabh Kumar and Henrik Marklund and Benjamin Van Roy},
year = {2023},
url = {https://api.semanticscholar.org/CorpusID:261076021}
}
@article{Lewandowski2024LearningCB,
title = {Learning Continually by Spectral Regularization},
author = {Alex Lewandowski and Saurabh Kumar and Dale Schuurmans and Andr'as Gyorgy and Marlos C. Machado},
journal = {ArXiv},
year = {2024},
volume = {abs/2406.06811},
url = {https://api.semanticscholar.org/CorpusID:270380086}
}
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
adam_atan2_pytorch-0.1.1.tar.gz
(418.8 kB
view details)
Built Distribution
File details
Details for the file adam_atan2_pytorch-0.1.1.tar.gz
.
File metadata
- Download URL: adam_atan2_pytorch-0.1.1.tar.gz
- Upload date:
- Size: 418.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 193407d4c6a4dfebd1cbeadbe46a5bfb06b33d8f61d42ff181aa9c49c721486b |
|
MD5 | 572e9b9e08f8a5a82eb0220c72fde792 |
|
BLAKE2b-256 | cae44796f5a1d521830b5169a07f9373f6b4b80aa412e97da769180878e6b147 |
File details
Details for the file adam_atan2_pytorch-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: adam_atan2_pytorch-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36643edd3065adbaccf99775b1d9ff46e11a5d1cc1ae4aa48fc70486d36dade3 |
|
MD5 | 342bc11c41d8bae107d0f59cb86b4655 |
|
BLAKE2b-256 | eab9410aa3242350c6e1e91bca21755f38f9ca19fa3450f81e5bd50429973ab2 |