Skip to main content

Adam-atan2 for Pytorch

Project description

Adam-atan2 - Pytorch (wip)

Implementation of the proposed Adam-atan2 optimizer in Pytorch

A multi-million dollar paper out of google deepmind basically proposes a small change to Adam (using atan2) for greater stability

Install

$ pip install adam-atan2-pytorch

Usage

# toy model

import torch
from torch import nn

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


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.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

adam_atan2_pytorch-0.0.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file adam_atan2_pytorch-0.0.1.tar.gz.

File metadata

  • Download URL: adam_atan2_pytorch-0.0.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for adam_atan2_pytorch-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c6b0c1a7f44ff146ed0cfb0edee6d963ef567c069bdc7b6c17799030f97369f1
MD5 214ba3489c1af2962be414ce3d365de4
BLAKE2b-256 af47c252cf7f8d8258aabf83fe322ca765f052868f7dff96397a1e67d1251dcf

See more details on using hashes here.

File details

Details for the file adam_atan2_pytorch-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for adam_atan2_pytorch-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ad1bf3f311b13ccd5548ec4d4cbf078caf1a89ffc438180d83a899cec882e94
MD5 0b3062d0bbf3ce87c246e1e5f962eb34
BLAKE2b-256 188bab365c20912564bd5df2d9c8359175ad7fc2862233aa657ab3474793f0b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page