skillfed

torch-optimizer

pytorch-optimizer

torch-optimizer v0.3.0 166.5K downloads/30d#10,494 on PyPI3,170
Permissive license Apache 2 DORMANT released

What it is and what it does

torch-optimizer is a collection of alternative optimization algorithms for PyTorch training, including AdaBound, RAdam, Lamb, DiffGrad, NovoGrad, MADGRAD, and many others. Each optimizer implements a different adaptive or momentum-based gradient descent variant, all exposing the same interface as PyTorch's standard optim module so they can be used as drop-in replacements.

You import the package and instantiate an optimizer by name, passing your model parameters and a learning rate, then call step() during training just as you would with standard optimizers. The package bundles research implementations of algorithms from academic papers, letting you experiment with different optimization strategies without implementing them yourself.

Use it for:

  • Experimenting with alternative optimizers like RAdam or Lamb to improve convergence on your specific model and dataset
  • Replacing standard Adam with AdaBound to get faster convergence with automatic learning rate scheduling
  • Using DiffGrad or NovoGrad when you want gradient-based adaptive methods beyond PyTorch's built-in optimizers
  • Prototyping with Ranger for potentially better generalization in deep learning
  • Comparing multiple optimizers systematically by swapping them in and out with the same interface

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a collection of alternative optimization algorithms for PyTorch that are compatible with the standard optim module interface.

Yes, if you want to experiment with alternative optimizers and your PyTorch version is not significantly newer than late 2021. The package is dormant but functional, has no known vulnerabilities, and installs cleanly. Be aware that it may not be actively maintained for the latest PyTorch releases, so test compatibility with your environment first.

Install

torch-optimizer on PyPI

pip

pip install torch-optimizer

uv

uv add torch-optimizer

poetry

poetry add torch-optimizer

Installing torch-optimizer

Before you install

Low install friction with a pure Python wheel. Maintenance is dormant—last release was October 2021 and last commit March 2024—but the package remains functional and the repository is not archived.

License in practice

Licensed under Apache 2 (permissive), so you can use it freely in commercial and private projects without copyleft obligations.

Quickstart

pip install torch-optimizer

import torch_optimizer as optim

optimizer = optim.DiffGrad(model.parameters(), lr=0.001)
optimizer.step()

Verify before relying

  • Whether all listed optimizers remain well-maintained or have known issues in recent PyTorch versions
  • Compatibility with PyTorch versions released after the package's last update in October 2021

Package facts

License Apache 2 (permissive)
Python support supports the current Python release (>=3.6.0)
Install friction low — pure-Python wheel
Runtime dependencies 2 — torch, pytorch-ranger
Maintenance dormant — 1,748 days since the last release
Last repo commit
First released
Downloads 166,479/month — #10,494 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: torch_optimizer-0.3.0-py3-none-any.whl

Keywords: torch-optimizer, pytorch, accsgd, adabound, adamod, diffgrad, lamb, lookahead, madgrad, novograd, pid, qhadam, qhm, radam, sgdw, yogi, ranger

Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Scientific/Engineering :: Artificial Intelligence

Tags

pytorch optimizer alternativesadvanced gradient descent methodsradam lamb diffgrad pytorchcustom pytorch optimizersadaptive learning rate algorithmspytorch training optimizationnovograd adabound madgrad
pytorch-trainingoptimization-algorithms

More Artificial Intelligence packages

Further reading