Skip to main content


Project description


torch-optimizer – collection of optimizers for PyTorch.

Simple example

import torch_optimizer as optim

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


Installation process is simple, just:

$ pip install torch_optimizer

Supported Optimizers


Optimizer based on the difference between the present and the immediate past gradient, the step size is adjusted for each parameter in such a way that it should have a larger step size for faster gradient changing parameters and a lower step size for lower gradient changing parameters.

Paper: diffGrad: An Optimization Method for Convolutional Neural Networks. (2019) [>]

Reference Code:


AdaMod method restricts the adaptive learning rates with adaptive and momental upper bounds. The dynamic learning rate bounds are based on the exponential moving averages of the adaptive learning rates themselves, which smooth out unexpected large learning rates and stabilize the training of deep neural networks.

Paper: An Adaptive and Momental Bound Method for Stochastic Learning. (2019) []

Reference Code:


Yogi is optimization algorithm based on ADAM with more fine grained effective learning rate control, and has similar theoretical guarantees on convergence as ADAM.

Paper: Adaptive Methods for Nonconvex Optimization (2018) []

Reference Code:


0.0.1 (YYYY-MM-DD)

  • Initial release.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for torch-optimizer, version 0.0.1a1
Filename, size File type Python version Upload date Hashes
Filename, size torch-optimizer-0.0.1a1.tar.gz (16.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page