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
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}
}
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.0.6.tar.gz
(417.8 kB
view details)
Built Distribution
File details
Details for the file adam_atan2_pytorch-0.0.6.tar.gz
.
File metadata
- Download URL: adam_atan2_pytorch-0.0.6.tar.gz
- Upload date:
- Size: 417.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1de9cd3a10c0e3c85782108ef53fd588679f6cc68eefd4ca37df1fd1d288a5b3 |
|
MD5 | b80ae5f46cb9d3af94679a35a5a61798 |
|
BLAKE2b-256 | efe11b68323692babc5bf748fd33d0436fba16b5af4fe95624dc1eb273d5d76a |
File details
Details for the file adam_atan2_pytorch-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: adam_atan2_pytorch-0.0.6-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f43340b82a0dc2d3b83f9077690e6cb8f1af650404f46e5195e31afe46c173d9 |
|
MD5 | e911c8ee392767926a92c245a95b51fe |
|
BLAKE2b-256 | 2ea546ebc570c236f91a7c1ecfc54f549cdcca8c5b4672956863b9323b95c54f |