adam-atan2-pytorch
Adam-atan2 for Pytorch
What it is and what it does
Adam-atan2-pytorch implements a modified Adam optimizer that replaces the epsilon term with atan2 to achieve numerical stability without requiring manual epsilon tuning. The core change is algorithmic—using atan2 in the update rule removes the need for epsilon altogether while maintaining scale invariance across different parameter ranges. This is based on research from DeepMind proposing the atan2 modification.
The package also includes features for improving plasticity in continual learning scenarios, where models must learn new tasks without catastrophic forgetting of old ones. It integrates with PyTorch's standard optimizer interface, so you instantiate it with model parameters and a learning rate, then call step() and zero_grad() in your training loop like any other optimizer. The implementation depends on einops for tensor operations and torch itself.
Use it for:
- Replace standard Adam in deep learning models where epsilon tuning is problematic or parameter scales vary widely.
- Continual learning pipelines where maintaining plasticity across task sequences is critical.
- Training scenarios where numerical stability without manual epsilon adjustment is desired.
- Research comparing optimizer variants with scale-invariant update rules.
- Large-scale training where removing epsilon hyperparameter reduces tuning overhead.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides an Adam optimizer variant using atan2 for numerical stability and scale invariance, with optional plasticity features for continual learning.
Yes, if you use PyTorch and want to experiment with a theoretically motivated Adam variant. Low install friction, permissive license, no known vulnerabilities, and active maintenance make it a low-risk addition. Best suited for researchers exploring optimizer variants or teams dealing with scale-invariance issues; standard Adam remains the safer default for most production training.
Install
adam-atan2-pytorch on PyPI
pip
pip install adam-atan2-pytorchuv
uv add adam-atan2-pytorchpoetry
poetry add adam-atan2-pytorchInstalling adam-atan2-pytorch
Before you install
Low install friction with only two runtime dependencies (einops and torch). Active maintenance status with a recent release 28 days ago.
License in practice
MIT License permits unrestricted use, modification, and distribution with only attribution and liability disclaimer required—no restrictions on commercial or private use.
Quickstart
pip install adam-atan2-pytorch
import torch
from adam_atan2_pytorch import AdamAtan2
model = torch.nn.Linear(10, 1)
opt = AdamAtan2(model.parameters(), lr=1e-4)
loss = model(torch.randn(10))
loss.backward()
opt.step()
opt.zero_grad()
Requires PyPI installation of torch and einops; Python 3.9 or later.
Verify before relying
- Whether plasticity features are enabled by default or require explicit configuration.
- Performance comparison with standard Adam on typical training tasks.
- Specific continual learning scenarios where plasticity features provide measurable benefit.
Package facts
| License | MIT License Copyright (c) 2024 Phil Wang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — einops, torch |
| Maintenance | actively maintained — 28 days since the last release |
| First released | |
| Downloads | 270,109/month — #8,242 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: adam_atan2_pytorch-0.4.0-py3-none-any.whl
Keywords: adam, artificial intelligence, deep learning, optimizers
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
hyper-connectionsImplements multiple residual streams in neural…
permissive · top 15,000 on PyPI
lion-pytorchLion is a PyTorch optimizer that implements an…
permissive · top 15,000 on PyPI
pytorch-rangerRanger is a PyTorch optimizer that combines…
permissive · top 15,000 on PyPI
flashoptimFlashOptim provides drop-in replacements for…
permissive · top 15,000 on PyPI
schedulefreeProvides schedule-free optimizers for PyTorch…
permissive · top 15,000 on PyPI
ema-pytorchMaintains an exponential moving average (EMA)…
permissive · top 15,000 on PyPI
pytorch_optimizerProvides a collection of modern optimizers,…
permissive · top 15,000 on PyPI
opacusOpacus enables training PyTorch models with…
permissive · top 15,000 on PyPI
tomesdSpeeds up Stable Diffusion image generation by…
permissive · top 15,000 on PyPI
torchaudioProvides PyTorch-based audio processing,…
permissive · top 5,000 on PyPI