pytorch-optimizer 2.11.2__tar.gz → 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. pytorch_optimizer-3.0.0/PKG-INFO +373 -0
  2. pytorch_optimizer-3.0.0/README.md +333 -0
  3. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pyproject.toml +39 -40
  4. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/__init__.py +49 -6
  5. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/base/scheduler.py +0 -1
  6. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/loss/jaccard.py +1 -1
  7. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/lr_scheduler/linear_warmup.py +1 -1
  8. pytorch_optimizer-3.0.0/pytorch_optimizer/lr_scheduler/rex.py +66 -0
  9. pytorch_optimizer-3.0.0/pytorch_optimizer/optimizer/adalite.py +168 -0
  10. pytorch_optimizer-3.0.0/pytorch_optimizer/optimizer/aida.py +198 -0
  11. pytorch_optimizer-3.0.0/pytorch_optimizer/optimizer/galore.py +249 -0
  12. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/ranger21.py +6 -0
  13. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/rotograd.py +1 -1
  14. pytorch_optimizer-3.0.0/pytorch_optimizer/optimizer/sam.py +672 -0
  15. pytorch_optimizer-3.0.0/pytorch_optimizer/optimizer/schedulefree.py +310 -0
  16. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/srmm.py +2 -2
  17. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/utils.py +27 -0
  18. pytorch_optimizer-2.11.2/PKG-INFO +0 -487
  19. pytorch_optimizer-2.11.2/README.rst +0 -448
  20. pytorch_optimizer-2.11.2/pytorch_optimizer/optimizer/gsam.py +0 -227
  21. pytorch_optimizer-2.11.2/pytorch_optimizer/optimizer/sam.py +0 -147
  22. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/LICENSE +0 -0
  23. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/base/__init__.py +0 -0
  24. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/base/exception.py +0 -0
  25. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/base/optimizer.py +0 -0
  26. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/base/types.py +0 -0
  27. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/loss/__init__.py +0 -0
  28. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/loss/bi_tempered.py +0 -0
  29. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/loss/cross_entropy.py +0 -0
  30. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/loss/dice.py +0 -0
  31. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/loss/f1.py +0 -0
  32. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/loss/focal.py +0 -0
  33. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/loss/ldam.py +0 -0
  34. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/loss/lovasz.py +0 -0
  35. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/loss/tversky.py +0 -0
  36. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/lr_scheduler/__init__.py +0 -0
  37. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/lr_scheduler/chebyshev.py +0 -0
  38. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/lr_scheduler/cosine_anealing.py +0 -0
  39. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/lr_scheduler/experimental/__init__.py +0 -0
  40. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/lr_scheduler/experimental/deberta_v3_lr_scheduler.py +0 -0
  41. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/lr_scheduler/proportion.py +0 -0
  42. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/__init__.py +0 -0
  43. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/a2grad.py +0 -0
  44. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adabelief.py +0 -0
  45. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adabound.py +0 -0
  46. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adadelta.py +0 -0
  47. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adafactor.py +0 -0
  48. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adahessian.py +0 -0
  49. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adai.py +0 -0
  50. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adamax.py +0 -0
  51. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adamod.py +0 -0
  52. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adamp.py +0 -0
  53. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adams.py +0 -0
  54. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adan.py +0 -0
  55. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adanorm.py +0 -0
  56. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adapnm.py +0 -0
  57. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adashift.py +0 -0
  58. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/adasmooth.py +0 -0
  59. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/agc.py +0 -0
  60. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/aggmo.py +0 -0
  61. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/alig.py +0 -0
  62. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/amos.py +0 -0
  63. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/apollo.py +0 -0
  64. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/avagrad.py +0 -0
  65. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/came.py +0 -0
  66. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/dadapt.py +0 -0
  67. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/diffgrad.py +0 -0
  68. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/fp16.py +0 -0
  69. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/fromage.py +0 -0
  70. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/gc.py +0 -0
  71. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/gravity.py +0 -0
  72. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/lamb.py +0 -0
  73. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/lars.py +0 -0
  74. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/lion.py +0 -0
  75. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/lomo.py +0 -0
  76. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/lookahead.py +0 -0
  77. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/madgrad.py +0 -0
  78. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/msvag.py +0 -0
  79. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/nero.py +0 -0
  80. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/novograd.py +0 -0
  81. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/padam.py +0 -0
  82. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/pcgrad.py +0 -0
  83. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/pid.py +0 -0
  84. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/pnm.py +0 -0
  85. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/prodigy.py +0 -0
  86. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/qhadam.py +0 -0
  87. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/qhm.py +0 -0
  88. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/radam.py +0 -0
  89. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/ranger.py +0 -0
  90. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/sgd.py +0 -0
  91. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/sgdp.py +0 -0
  92. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/shampoo.py +0 -0
  93. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/shampoo_utils.py +0 -0
  94. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/sm3.py +0 -0
  95. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/sophia.py +0 -0
  96. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/swats.py +0 -0
  97. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/tiger.py +0 -0
  98. {pytorch_optimizer-2.11.2 → pytorch_optimizer-3.0.0}/pytorch_optimizer/optimizer/yogi.py +0 -0
@@ -0,0 +1,373 @@
1
+ Metadata-Version: 2.1
2
+ Name: pytorch_optimizer
3
+ Version: 3.0.0
4
+ Summary: optimizer & lr scheduler & objective function collections in PyTorch
5
+ Home-page: https://github.com/kozistr/pytorch_optimizer
6
+ License: Apache-2.0
7
+ Keywords: pytorch,deep-learning,optimizer,lr scheduler,A2Grad,ASGD,AccSGD,AdaBelief,AdaBound,AdaDelta,AdaFactor,AdaMax,AdaMod,AdaNorm,AdaPNM,AdaSmooth,AdaHessian,Adai,Adalite,AdamP,AdamS,Adan,AggMo,Aida,AliG,Amos,Apollo,AvaGrad,bSAM,CAME,DAdaptAdaGrad,DAdaptAdam,DAdaptAdan,DAdaptSGD,DAdaptLion,DiffGrad,Fromage,GaLore,Gravity,GSAM,LARS,Lamb,Lion,LOMO,Lookahead,MADGRAD,MSVAG,Nero,NovoGrad,PAdam,PCGrad,PID,PNM,Prodigy,QHAdam,QHM,RAdam,Ranger,Ranger21,RotoGrad,SAM,ScheduleFreeSGD,ScheduleFreeAdamW,SGDP,Shampoo,ScalableShampoo,SGDW,SignSGD,SM3,SopihaH,SRMM,SWATS,Tiger,WSAM,Yogi,BCE,BCEFocal,Focal,FocalCosine,SoftF1,Dice,LDAM,Jaccard,Bi-Tempered,Tversky,FocalTversky,LovaszHinge,bitsandbytes
8
+ Author: kozistr
9
+ Author-email: kozistr@gmail.com
10
+ Maintainer: kozistr
11
+ Maintainer-email: kozistr@gmail.com
12
+ Requires-Python: >=3.8,<4.0.0
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Education
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: License :: OSI Approved :: Apache Software License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Classifier: Programming Language :: Python :: 3.6
26
+ Classifier: Programming Language :: Python :: 3.7
27
+ Classifier: Topic :: Scientific/Engineering
28
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
29
+ Classifier: Topic :: Software Development
30
+ Classifier: Topic :: Software Development :: Libraries
31
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
32
+ Provides-Extra: bitsandbytes
33
+ Requires-Dist: bitsandbytes (>=0.43,<0.44) ; extra == "bitsandbytes"
34
+ Requires-Dist: numpy ; python_version >= "3.8"
35
+ Requires-Dist: torch (>=1.10) ; python_version >= "3.8"
36
+ Project-URL: Documentation, https://pytorch-optimizers.readthedocs.io/en/latest
37
+ Project-URL: Repository, https://github.com/kozistr/pytorch_optimizer
38
+ Description-Content-Type: text/markdown
39
+
40
+ # pytorch-optimizer
41
+
42
+ | | |
43
+ |---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
44
+ | Build | ![workflow](https://github.com/kozistr/pytorch_optimizer/actions/workflows/ci.yml/badge.svg?branch=main) [![Documentation Status](https://readthedocs.org/projects/pytorch-optimizers/badge/?version=latest)](https://pytorch-optimizers.readthedocs.io/en/latest/?badge=latest) |
45
+ | Quality | [![codecov](https://codecov.io/gh/kozistr/pytorch_optimizer/branch/main/graph/badge.svg?token=L4K00EA0VD)](https://codecov.io/gh/kozistr/pytorch_optimizer) ![black](https://img.shields.io/badge/code%20style-black-000000.svg) [![ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff) |
46
+ | Package | [![PyPI version](https://badge.fury.io/py/pytorch-optimizer.svg)](https://badge.fury.io/py/pytorch-optimizer) [![PyPI pyversions](https://img.shields.io/pypi/pyversions/pytorch-optimizer.svg)](https://pypi.python.org/pypi/pytorch-optimizer/) |
47
+ | Status | [![PyPi download](https://static.pepy.tech/badge/pytorch-optimizer)](https://pepy.tech/project/pytorch-optimizer) [![PyPi month download](https://static.pepy.tech/badge/pytorch-optimizer/month)](https://pepy.tech/project/pytorch-optimizer) |
48
+ | License | [![apache](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) |
49
+
50
+ **pytorch-optimizer** is optimizer & lr scheduler collections in PyTorch.
51
+ I just re-implemented (speed & memory tweaks, plug-ins) the algorithm while based on the original paper. Also, It includes useful and practical optimization ideas.
52
+ Currently, **67 optimizers (+ `bitsandbytes`)**, **11 lr schedulers**, and **13 loss functions** are supported!
53
+
54
+ Highly inspired by [pytorch-optimizer](https://github.com/jettify/pytorch-optimizer).
55
+
56
+ ## Getting Started
57
+
58
+ For more, see the [documentation](https://pytorch-optimizers.readthedocs.io/en/latest/).
59
+
60
+ Most optimizers are under MIT or Apache 2.0 license, but a few optimizers like `Fromage`, `Nero` have `CC BY-NC-SA 4.0 license`, which is non-commercial.
61
+ So, please double-check the license before using it at your work.
62
+
63
+ ### Installation
64
+
65
+ ```bash
66
+ $ pip3 install pytorch-optimizer
67
+ ```
68
+
69
+ From `v2.12.0`, you can install and import `bitsandbytes` optimizers.
70
+ please check [the requirements](https://github.com/TimDettmers/bitsandbytes?tab=readme-ov-file#tldr) before installing it.
71
+
72
+ From `v3.0.0`, drop `Python 3.7` support. However, you can still use this package with `Python 3.7` by installing with `--ignore-requires-python` option.
73
+
74
+ ```bash
75
+ $ pip install "pytorch-optimizer[bitsandbytes]"
76
+ ```
77
+
78
+ ### Simple Usage
79
+
80
+ ```python
81
+ from pytorch_optimizer import AdamP
82
+
83
+ model = YourModel()
84
+ optimizer = AdamP(model.parameters())
85
+
86
+ # or you can use optimizer loader, simply passing a name of the optimizer.
87
+
88
+ from pytorch_optimizer import load_optimizer
89
+
90
+ optimizer = load_optimizer(optimizer='adamp')(model.parameters())
91
+
92
+ # if you install `bitsandbytes` optimizer, you can use `8-bit` optimizers from `pytorch-optimizer`.
93
+
94
+ from pytorch_optimizer import load_optimizer
95
+
96
+ opt = load_optimizer(optimizer='bnb_adamw8bit')
97
+ optimizer = opt(model.parameters())
98
+ ```
99
+
100
+ Also, you can load the optimizer via `torch.hub`.
101
+
102
+ ```python
103
+ import torch
104
+
105
+ model = YourModel()
106
+ opt = torch.hub.load('kozistr/pytorch_optimizer', 'adamp')
107
+ optimizer = opt(model.parameters())
108
+ ```
109
+
110
+ If you want to build the optimizer with parameters & configs, there's `create_optimizer()` API.
111
+
112
+ ```python
113
+ from pytorch_optimizer import create_optimizer
114
+
115
+ optimizer = create_optimizer(
116
+ model,
117
+ 'adamp',
118
+ lr=1e-3,
119
+ weight_decay=1e-3,
120
+ use_gc=True,
121
+ use_lookahead=True,
122
+ )
123
+ ```
124
+
125
+ ## Supported Optimizers
126
+
127
+ You can check the supported optimizers with below code.
128
+
129
+ ```python
130
+ from pytorch_optimizer import get_supported_optimizers
131
+
132
+ supported_optimizers = get_supported_optimizers()
133
+ ```
134
+
135
+ | Optimizer | Description | Official Code | Paper | Citation |
136
+ |---------------|---------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
137
+ | AdaBelief | *Adapting Step-sizes by the Belief in Observed Gradients* | [github](https://github.com/juntang-zhuang/Adabelief-Optimizer) | <https://arxiv.org/abs/2010.07468> | [cite](https://ui.adsabs.harvard.edu/abs/2020arXiv201007468Z/exportcitation) |
138
+ | AdaBound | *Adaptive Gradient Methods with Dynamic Bound of Learning Rate* | [github](https://github.com/Luolc/AdaBound/blob/master/adabound/adabound.py) | <https://openreview.net/forum?id=Bkg3g2R9FX> | [cite](https://github.com/Luolc/AdaBound#citing) |
139
+ | AdaHessian | *An Adaptive Second Order Optimizer for Machine Learning* | [github](https://github.com/amirgholami/adahessian) | <https://arxiv.org/abs/2006.00719> | [cite](https://github.com/amirgholami/adahessian#citation) |
140
+ | AdamD | *Improved bias-correction in Adam* | | <https://arxiv.org/abs/2110.10828> | [cite](https://ui.adsabs.harvard.edu/abs/2021arXiv211010828S/exportcitation) |
141
+ | AdamP | *Slowing Down the Slowdown for Momentum Optimizers on Scale-invariant Weights* | [github](https://github.com/clovaai/AdamP) | <https://arxiv.org/abs/2006.08217> | [cite](https://github.com/clovaai/AdamP#how-to-cite) |
142
+ | diffGrad | *An Optimization Method for Convolutional Neural Networks* | [github](https://github.com/shivram1987/diffGrad) | <https://arxiv.org/abs/1909.11015v3> | [cite](https://ui.adsabs.harvard.edu/abs/2019arXiv190911015D/exportcitation) |
143
+ | MADGRAD | *A Momentumized, Adaptive, Dual Averaged Gradient Method for Stochastic* | [github](https://github.com/facebookresearch/madgrad) | <https://arxiv.org/abs/2101.11075> | [cite](https://github.com/facebookresearch/madgrad#tech-report) |
144
+ | RAdam | *On the Variance of the Adaptive Learning Rate and Beyond* | [github](https://github.com/LiyuanLucasLiu/RAdam) | <https://arxiv.org/abs/1908.03265> | [cite](https://github.com/LiyuanLucasLiu/RAdam#citation) |
145
+ | Ranger | *a synergistic optimizer combining RAdam and LookAhead, and now GC in one optimizer* | [github](https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer) | <https://bit.ly/3zyspC3> | [cite](https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer#citing-this-work) |
146
+ | Ranger21 | *a synergistic deep learning optimizer* | [github](https://github.com/lessw2020/Ranger21) | <https://arxiv.org/abs/2106.13731> | [cite](https://github.com/lessw2020/Ranger21#referencing-this-work) |
147
+ | Lamb | *Large Batch Optimization for Deep Learning* | [github](https://github.com/cybertronai/pytorch-lamb) | <https://arxiv.org/abs/1904.00962> | [cite](https://ui.adsabs.harvard.edu/abs/2019arXiv190400962Y/exportcitation) |
148
+ | Shampoo | *Preconditioned Stochastic Tensor Optimization* | [github](https://github.com/moskomule/shampoo.pytorch) | <https://arxiv.org/abs/1802.09568> | [cite](https://ui.adsabs.harvard.edu/abs/2018arXiv180209568G/exportcitation) |
149
+ | Nero | *Learning by Turning: Neural Architecture Aware Optimisation* | [github](https://github.com/jxbz/nero) | <https://arxiv.org/abs/2102.07227> | [cite](https://ui.adsabs.harvard.edu/abs/2021arXiv210207227L/exportcitation) |
150
+ | Adan | *Adaptive Nesterov Momentum Algorithm for Faster Optimizing Deep Models* | [github](https://github.com/sail-sg/Adan) | <https://arxiv.org/abs/2208.06677> | [cite](https://ui.adsabs.harvard.edu/abs/2022arXiv220806677X/exportcitation) |
151
+ | Adai | *Disentangling the Effects of Adaptive Learning Rate and Momentum* | [github](https://github.com/zeke-xie/adaptive-inertia-adai) | <https://arxiv.org/abs/2006.15815> | [cite](https://github.com/zeke-xie/adaptive-inertia-adai#citing) |
152
+ | SAM | *Sharpness-Aware Minimization* | [github](https://github.com/davda54/sam) | <https://arxiv.org/abs/2010.01412> | [cite](https://ui.adsabs.harvard.edu/abs/2020arXiv201001412F/exportcitation) |
153
+ | ASAM | *Adaptive Sharpness-Aware Minimization* | [github](https://github.com/davda54/sam) | <https://arxiv.org/abs/2102.11600> | [cite](https://ui.adsabs.harvard.edu/abs/2021arXiv210211600K/exportcitation) |
154
+ | GSAM | *Surrogate Gap Guided Sharpness-Aware Minimization* | [github](https://github.com/juntang-zhuang/GSAM) | <https://openreview.net/pdf?id=edONMAnhLu-> | [cite](https://github.com/juntang-zhuang/GSAM#citation) |
155
+ | D-Adaptation | *Learning-Rate-Free Learning by D-Adaptation* | [github](https://github.com/facebookresearch/dadaptation) | <https://arxiv.org/abs/2301.07733> | [cite](https://ui.adsabs.harvard.edu/abs/2023arXiv230107733D/exportcitation) |
156
+ | AdaFactor | *Adaptive Learning Rates with Sublinear Memory Cost* | [github](https://github.com/DeadAt0m/adafactor-pytorch) | <https://arxiv.org/abs/1804.04235> | [cite](https://ui.adsabs.harvard.edu/abs/2018arXiv180404235S/exportcitation) |
157
+ | Apollo | *An Adaptive Parameter-wise Diagonal Quasi-Newton Method for Nonconvex Stochastic Optimization* | [github](https://github.com/XuezheMax/apollo) | <https://arxiv.org/abs/2009.13586> | [cite](https://ui.adsabs.harvard.edu/abs/2020arXiv200913586M/exportcitation) |
158
+ | NovoGrad | *Stochastic Gradient Methods with Layer-wise Adaptive Moments for Training of Deep Networks* | [github](https://github.com/lonePatient/NovoGrad-pytorch) | <https://arxiv.org/abs/1905.11286> | [cite](https://ui.adsabs.harvard.edu/abs/2019arXiv190511286G/exportcitation) |
159
+ | Lion | *Symbolic Discovery of Optimization Algorithms* | [github](https://github.com/google/automl/tree/master/lion) | <https://arxiv.org/abs/2302.06675> | [cite](https://github.com/google/automl/tree/master/lion#citation) |
160
+ | Ali-G | *Adaptive Learning Rates for Interpolation with Gradients* | [github](https://github.com/oval-group/ali-g) | <https://arxiv.org/abs/1906.05661> | [cite](https://github.com/oval-group/ali-g#adaptive-learning-rates-for-interpolation-with-gradients) |
161
+ | SM3 | *Memory-Efficient Adaptive Optimization* | [github](https://github.com/google-research/google-research/tree/master/sm3) | <https://arxiv.org/abs/1901.11150> | [cite](https://ui.adsabs.harvard.edu/abs/2019arXiv190111150A/exportcitation) |
162
+ | AdaNorm | *Adaptive Gradient Norm Correction based Optimizer for CNNs* | [github](https://github.com/shivram1987/AdaNorm) | <https://arxiv.org/abs/2210.06364> | [cite](https://github.com/shivram1987/AdaNorm/tree/main#citation) |
163
+ | RotoGrad | *Gradient Homogenization in Multitask Learning* | [github](https://github.com/adrianjav/rotograd) | <https://openreview.net/pdf?id=T8wHz4rnuGL> | [cite](https://github.com/adrianjav/rotograd#citing) |
164
+ | A2Grad | *Optimal Adaptive and Accelerated Stochastic Gradient Descent* | [github](https://github.com/severilov/A2Grad_optimizer) | <https://arxiv.org/abs/1810.00553> | [cite](https://ui.adsabs.harvard.edu/abs/2018arXiv181000553D/exportcitation) |
165
+ | AccSGD | *Accelerating Stochastic Gradient Descent For Least Squares Regression* | [github](https://github.com/rahulkidambi/AccSGD) | <https://arxiv.org/abs/1704.08227> | [cite](https://github.com/rahulkidambi/AccSGD#citation) |
166
+ | SGDW | *Decoupled Weight Decay Regularization* | [github](https://github.com/loshchil/AdamW-and-SGDW) | <https://arxiv.org/abs/1711.05101> | [cite](https://github.com/loshchil/AdamW-and-SGDW#contact) |
167
+ | ASGD | *Adaptive Gradient Descent without Descent* | [github](https://github.com/ymalitsky/adaptive_GD) | <https://arxiv.org/abs/1910.09529> | [cite](https://github.com/ymalitsky/adaptive_GD#reference) |
168
+ | Yogi | *Adaptive Methods for Nonconvex Optimization* | | [NIPS 2018](https://papers.nips.cc/paper/8186-adaptive-methods-for-nonconvex-optimization) | [cite](https://proceedings.neurips.cc/paper_files/paper/2018/hash/90365351ccc7437a1309dc64e4db32a3-Abstract.html) |
169
+ | SWATS | *Improving Generalization Performance by Switching from Adam to SGD* | | <https://arxiv.org/abs/1712.07628> | [cite](https://ui.adsabs.harvard.edu/abs/2017arXiv171207628S/exportcitation) |
170
+ | Fromage | *On the distance between two neural networks and the stability of learning* | [github](https://github.com/jxbz/fromage) | <https://arxiv.org/abs/2002.03432> | [cite](https://github.com/jxbz/fromage#citation) |
171
+ | MSVAG | *Dissecting Adam: The Sign, Magnitude and Variance of Stochastic Gradients* | [github](https://github.com/lballes/msvag) | <https://arxiv.org/abs/1705.07774> | [cite](https://github.com/lballes/msvag#citation) |
172
+ | AdaMod | *An Adaptive and Momental Bound Method for Stochastic Learning* | [github](https://github.com/lancopku/AdaMod) | <https://arxiv.org/abs/1910.12249> | [cite](https://github.com/lancopku/AdaMod#citation) |
173
+ | AggMo | *Aggregated Momentum: Stability Through Passive Damping* | [github](https://github.com/AtheMathmo/AggMo) | <https://arxiv.org/abs/1804.00325> | [cite](https://ui.adsabs.harvard.edu/abs/2018arXiv180400325L/exportcitation) |
174
+ | QHAdam | *Quasi-hyperbolic momentum and Adam for deep learning* | [github](https://github.com/facebookresearch/qhoptim) | <https://arxiv.org/abs/1810.06801> | [cite](https://github.com/facebookresearch/qhoptim#reference) |
175
+ | PID | *A PID Controller Approach for Stochastic Optimization of Deep Networks* | [github](https://github.com/tensorboy/PIDOptimizer) | [CVPR 18](http://www4.comp.polyu.edu.hk/~cslzhang/paper/CVPR18_PID.pdf) | [cite](https://github.com/tensorboy/PIDOptimizer#citation) |
176
+ | Gravity | *a Kinematic Approach on Optimization in Deep Learning* | [github](https://github.com/dariush-bahrami/gravity.optimizer) | <https://arxiv.org/abs/2101.09192> | [cite](https://ui.adsabs.harvard.edu/abs/2021arXiv210109192B/exportcitation) |
177
+ | AdaSmooth | *An Adaptive Learning Rate Method based on Effective Ratio* | | <https://arxiv.org/abs/2204.00825v1> | [cite](https://ui.adsabs.harvard.edu/abs/2022arXiv220400825L/exportcitation) |
178
+ | SRMM | *Stochastic regularized majorization-minimization with weakly convex and multi-convex surrogates* | [github](https://github.com/HanbaekLyu/SRMM) | <https://arxiv.org/abs/2201.01652> | [cite](https://ui.adsabs.harvard.edu/abs/2022arXiv220101652L/exportcitation) |
179
+ | AvaGrad | *Domain-independent Dominance of Adaptive Methods* | [github](https://github.com/lolemacs/avagrad) | <https://arxiv.org/abs/1912.01823> | [cite](https://ui.adsabs.harvard.edu/abs/2019arXiv191201823S/exportcitation) |
180
+ | PCGrad | *Gradient Surgery for Multi-Task Learning* | [github](https://github.com/tianheyu927/PCGrad) | <https://arxiv.org/abs/2001.06782> | [cite](https://github.com/tianheyu927/PCGrad#reference) |
181
+ | AMSGrad | *On the Convergence of Adam and Beyond* | | <https://openreview.net/pdf?id=ryQu7f-RZ> | [cite](https://ui.adsabs.harvard.edu/abs/2019arXiv190409237R/exportcitation) |
182
+ | Lookahead | *k steps forward, 1 step back* | [github](https://github.com/pytorch/examples/tree/main/imagenet) | <https://arxiv.org/abs/1907.08610> | [cite](https://ui.adsabs.harvard.edu/abs/2019arXiv190708610Z/exportcitation) |
183
+ | PNM | *Manipulating Stochastic Gradient Noise to Improve Generalization* | [github](https://github.com/zeke-xie/Positive-Negative-Momentum) | <https://arxiv.org/abs/2103.17182> | [cite](https://github.com/zeke-xie/Positive-Negative-Momentum#citing) |
184
+ | GC | *Gradient Centralization* | [github](https://github.com/Yonghongwei/Gradient-Centralization) | <https://arxiv.org/abs/2004.01461> | [cite](https://github.com/Yonghongwei/Gradient-Centralization#citation) |
185
+ | AGC | *Adaptive Gradient Clipping* | [github](https://github.com/deepmind/deepmind-research/tree/master/nfnets) | <https://arxiv.org/abs/2102.06171> | [cite](https://ui.adsabs.harvard.edu/abs/2021arXiv210206171B/exportcitation) |
186
+ | Stable WD | *Understanding and Scheduling Weight Decay* | [github](https://github.com/zeke-xie/stable-weight-decay-regularization) | <https://arxiv.org/abs/2011.11152> | [cite](https://ui.adsabs.harvard.edu/abs/2020arXiv201111152X/exportcitation) |
187
+ | Softplus T | *Calibrating the Adaptive Learning Rate to Improve Convergence of ADAM* | | <https://arxiv.org/abs/1908.00700> | [cite](https://ui.adsabs.harvard.edu/abs/2019arXiv190800700T/exportcitation) |
188
+ | Un-tuned w/u | *On the adequacy of untuned warmup for adaptive optimization* | | <https://arxiv.org/abs/1910.04209> | [cite](https://ui.adsabs.harvard.edu/abs/2019arXiv191004209M/exportcitation) |
189
+ | Norm Loss | *An efficient yet effective regularization method for deep neural networks* | | <https://arxiv.org/abs/2103.06583> | [cite](https://ui.adsabs.harvard.edu/abs/2021arXiv210306583G/exportcitation) |
190
+ | AdaShift | *Decorrelation and Convergence of Adaptive Learning Rate Methods* | [github](https://github.com/MichaelKonobeev/adashift) | <https://arxiv.org/abs/1810.00143v4> | [cite](https://ui.adsabs.harvard.edu/abs/2018arXiv181000143Z/exportcitation) |
191
+ | AdaDelta | *An Adaptive Learning Rate Method* | | <https://arxiv.org/abs/1212.5701v1> | [cite](https://ui.adsabs.harvard.edu/abs/2012arXiv1212.5701Z/exportcitation) |
192
+ | Amos | *An Adam-style Optimizer with Adaptive Weight Decay towards Model-Oriented Scale* | [github](https://github.com/google-research/jestimator) | <https://arxiv.org/abs/2210.11693> | [cite](https://ui.adsabs.harvard.edu/abs/2022arXiv221011693T/exportcitation) |
193
+ | SignSGD | *Compressed Optimisation for Non-Convex Problems* | [github](https://github.com/jxbz/signSGD) | <https://arxiv.org/abs/1802.04434> | [cite](https://ui.adsabs.harvard.edu/abs/2018arXiv180204434B/exportcitation) |
194
+ | Sophia | *A Scalable Stochastic Second-order Optimizer for Language Model Pre-training* | [github](https://github.com/Liuhong99/Sophia) | <https://arxiv.org/abs/2305.14342> | [cite](https://github.com/Liuhong99/Sophia) |
195
+ | Prodigy | *An Expeditiously Adaptive Parameter-Free Learner* | [github](https://github.com/konstmish/prodigy) | <https://arxiv.org/abs/2306.06101> | [cite](https://github.com/konstmish/prodigy#how-to-cite) |
196
+ | PAdam | *Closing the Generalization Gap of Adaptive Gradient Methods in Training Deep Neural Networks* | [github](https://github.com/uclaml/Padam) | <https://arxiv.org/abs/1806.06763> | [cite](https://github.com/uclaml/Padam#citation) |
197
+ | LOMO | *Full Parameter Fine-tuning for Large Language Models with Limited Resources* | [github](https://github.com/OpenLMLab/LOMO) | <https://arxiv.org/abs/2306.09782> | [cite](https://github.com/OpenLMLab/LOMO#citation) |
198
+ | Tiger | *A Tight-fisted Optimizer, an optimizer that is extremely budget-conscious* | [github](https://github.com/bojone/tiger) | | [cite](https://github.com/bojone/tiger/blob/main/README_en.md#citation) |
199
+ | CAME | *Confidence-guided Adaptive Memory Efficient Optimization* | [github](https://github.com/huawei-noah/Pretrained-Language-Model/tree/master/CAME) | <https://aclanthology.org/2023.acl-long.243/> | [cite](https://github.com/huawei-noah/Pretrained-Language-Model/tree/master/CAME#citation) |
200
+ | WSAM | *Sharpness-Aware Minimization Revisited: Weighted Sharpness as a Regularization Term* | [github](https://github.com/intelligent-machine-learning/dlrover/blob/master/atorch/atorch/optimizers/wsam.py) | <https://arxiv.org/abs/2305.15817> | [cite](https://github.com/intelligent-machine-learning/dlrover) |
201
+ | Aida | *A DNN Optimizer that Improves over AdaBelief by Suppression of the Adaptive Stepsize Range* | [github](https://github.com/guoqiang-zhang-x/Aida-Optimizer) | <https://arxiv.org/abs/2203.13273> | [cite](https://github.com/guoqiang-zhang-x/Aida-Optimizer?tab=readme-ov-file#1-brief-description-of-aida) |
202
+ | GaLore | *Memory-Efficient LLM Training by Gradient Low-Rank Projection* | [github](https://github.com/jiaweizzhao/GaLore) | <https://arxiv.org/abs/2403.03507> | [cite](https://github.com/jiaweizzhao/GaLore/tree/master?tab=readme-ov-file#citation) |
203
+ | Adalite | *Adalite optimizer* | [github](https://github.com/VatsaDev/adalite) | <https://github.com/VatsaDev/adalite> | [cite](https://github.com/VatsaDev/adalite) |
204
+ | bSAM | *SAM as an Optimal Relaxation of Bayes* | [github](https://github.com/team-approx-bayes/bayesian-sam) | <https://arxiv.org/abs/2210.01620> | [cite](https://ui.adsabs.harvard.edu/abs/2022arXiv221001620M/exportcitation) |
205
+ | Schedule-Free | *Schedule-Free Optimizers* | [github](https://github.com/facebookresearch/schedule_free) | <https://github.com/facebookresearch/schedule_free> | [cite](https://github.com/facebookresearch/schedule_free) |
206
+
207
+ ## Supported LR Scheduler
208
+
209
+ You can check the supported learning rate schedulers with below code.
210
+
211
+ ```python
212
+ from pytorch_optimizer import get_supported_lr_schedulers
213
+
214
+ supported_lr_schedulers = get_supported_lr_schedulers()
215
+ ```
216
+
217
+ | LR Scheduler | Description | Official Code | Paper | Citation |
218
+ |-----------------|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|------------------------------------------------------------------------------|
219
+ | Explore-Exploit | *Wide-minima Density Hypothesis and the Explore-Exploit Learning Rate Schedule* | | <https://arxiv.org/abs/2003.03977> | [cite](https://ui.adsabs.harvard.edu/abs/2020arXiv200303977I/exportcitation) |
220
+ | Chebyshev | *Acceleration via Fractal Learning Rate Schedules* | | <https://arxiv.org/abs/2103.01338> | [cite](https://ui.adsabs.harvard.edu/abs/2021arXiv210301338A/exportcitation) |
221
+ | REX | *Revisiting Budgeted Training with an Improved Schedule* | [github](https://github.com/Nerogar/OneTrainer/blob/2c6f34ea0838e5a86774a1cf75093d7e97c70f03/modules/util/lr_scheduler_util.py#L66) | <https://arxiv.org/abs/2107.04197> | [cite](https://ui.adsabs.harvard.edu/abs/2021arXiv210704197C/exportcitation) |
222
+
223
+ ## Supported Loss Function
224
+
225
+ You can check the supported loss functions with below code.
226
+
227
+ ```python
228
+ from pytorch_optimizer import get_supported_loss_functions
229
+
230
+ supported_loss_functions = get_supported_loss_functions()
231
+ ```
232
+
233
+ | Loss Functions | Description | Official Code | Paper | Citation |
234
+ |-----------------|-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|------------------------------------|------------------------------------------------------------------------------|
235
+ | Label Smoothing | *Rethinking the Inception Architecture for Computer Vision* | | <https://arxiv.org/abs/1512.00567> | [cite](https://ui.adsabs.harvard.edu/abs/2015arXiv151200567S/exportcitation) |
236
+ | Focal | *Focal Loss for Dense Object Detection* | | <https://arxiv.org/abs/1708.02002> | [cite](https://ui.adsabs.harvard.edu/abs/2017arXiv170802002L/exportcitation) |
237
+ | Focal Cosine | *Data-Efficient Deep Learning Method for Image Classification Using Data Augmentation, Focal Cosine Loss, and Ensemble* | | <https://arxiv.org/abs/2007.07805> | [cite](https://ui.adsabs.harvard.edu/abs/2020arXiv200707805K/exportcitation) |
238
+ | LDAM | *Learning Imbalanced Datasets with Label-Distribution-Aware Margin Loss* | [github](https://github.com/kaidic/LDAM-DRW) | <https://arxiv.org/abs/1906.07413> | [cite](https://github.com/kaidic/LDAM-DRW#reference) |
239
+ | Jaccard (IOU) | *IoU Loss for 2D/3D Object Detection* | | <https://arxiv.org/abs/1908.03851> | [cite](https://ui.adsabs.harvard.edu/abs/2019arXiv190803851Z/exportcitation) |
240
+ | Bi-Tempered | *The Principle of Unchanged Optimality in Reinforcement Learning Generalization* | | <https://arxiv.org/abs/1906.03361> | [cite](https://ui.adsabs.harvard.edu/abs/2019arXiv190600336I/exportcitation) |
241
+ | Tversky | *Tversky loss function for image segmentation using 3D fully convolutional deep networks* | | <https://arxiv.org/abs/1706.05721> | [cite](https://ui.adsabs.harvard.edu/abs/2017arXiv170605721S/exportcitation) |
242
+ | Lovasz Hinge | *A tractable surrogate for the optimization of the intersection-over-union measure in neural networks* | [github](https://github.com/bermanmaxim/LovaszSoftmax) | <https://arxiv.org/abs/1705.08790> | [cite](https://github.com/bermanmaxim/LovaszSoftmax#citation) |
243
+
244
+ ## Useful Resources
245
+
246
+ Several optimization ideas to regularize & stabilize the training. Most of the ideas are applied in `Ranger21` optimizer.
247
+
248
+ Also, most of the captures are taken from `Ranger21` paper.
249
+
250
+ | | | |
251
+ |---------------------------------------------------------------------------------|-----------------------------------------------------------------------|-----------------------------------------------------------------------------------|
252
+ | [Adaptive Gradient Clipping](#adaptive-gradient-clipping) | [Gradient Centralization](#gradient-centralization) | [Softplus Transformation](#softplus-transformation) |
253
+ | [Gradient Normalization](#gradient-normalization) | [Norm Loss](#norm-loss) | [Positive-Negative Momentum](#positive-negative-momentum) |
254
+ | [Linear learning rate warmup](#linear-learning-rate-warmup) | [Stable weight decay](#stable-weight-decay) | [Explore-exploit learning rate schedule](#explore-exploit-learning-rate-schedule) |
255
+ | [Lookahead](#lookahead) | [Chebyshev learning rate schedule](#chebyshev-learning-rate-schedule) | [(Adaptive) Sharpness-Aware Minimization](#adaptive-sharpness-aware-minimization) |
256
+ | [On the Convergence of Adam and Beyond](#on-the-convergence-of-adam-and-beyond) | [Improved bias-correction in Adam](#improved-bias-correction-in-adam) | [Adaptive Gradient Norm Correction](#adaptive-gradient-norm-correction) |
257
+
258
+ ### Adaptive Gradient Clipping
259
+
260
+ This idea originally proposed in `NFNet (Normalized-Free Network)` paper. `AGC (Adaptive Gradient Clipping)` clips gradients based on the `unit-wise ratio of gradient norms to parameter norms`.
261
+
262
+ * code : [github](https://github.com/deepmind/deepmind-research/tree/master/nfnets)
263
+ * paper : [arXiv](https://arxiv.org/abs/2102.06171)
264
+
265
+ ### Gradient Centralization
266
+
267
+ | |
268
+ |---------------------------------------------------------------------------------------------------------------|
269
+ | ![image](https://raw.githubusercontent.com/kozistr/pytorch_optimizer/main/assets/gradient_centralization.png) |
270
+
271
+ `Gradient Centralization (GC)` operates directly on gradients by centralizing the gradient to have zero mean.
272
+
273
+ * code : [github](https://github.com/Yonghongwei/Gradient-Centralization)
274
+ * paper : [arXiv](https://arxiv.org/abs/2004.01461)
275
+
276
+ ### Softplus Transformation
277
+
278
+ By running the final variance denom through the softplus function, it lifts extremely tiny values to keep them viable.
279
+
280
+ * paper : [arXiv](https://arxiv.org/abs/1908.00700)
281
+
282
+ ### Gradient Normalization
283
+
284
+ ### Norm Loss
285
+
286
+ | |
287
+ |-------------------------------------------------------------------------------------------------|
288
+ | ![image](https://raw.githubusercontent.com/kozistr/pytorch_optimizer/main/assets/norm_loss.png) |
289
+
290
+ * paper : [arXiv](https://arxiv.org/abs/2103.06583)
291
+
292
+ ### Positive-Negative Momentum
293
+
294
+ | |
295
+ |------------------------------------------------------------------------------------------------------------------|
296
+ | ![image](https://raw.githubusercontent.com/kozistr/pytorch_optimizer/main/assets/positive_negative_momentum.png) |
297
+
298
+ * code : [github](https://github.com/zeke-xie/Positive-Negative-Momentum)
299
+ * paper : [arXiv](https://arxiv.org/abs/2103.17182)
300
+
301
+ ### Linear learning rate warmup
302
+
303
+ | |
304
+ |--------------------------------------------------------------------------------------------------------|
305
+ | ![image](https://raw.githubusercontent.com/kozistr/pytorch_optimizer/main/assets/linear_lr_warmup.png) |
306
+
307
+ * paper : [arXiv](https://arxiv.org/abs/1910.04209)
308
+
309
+ ### Stable weight decay
310
+
311
+ | |
312
+ |-----------------------------------------------------------------------------------------------------------|
313
+ | ![image](https://raw.githubusercontent.com/kozistr/pytorch_optimizer/main/assets/stable_weight_decay.png) |
314
+
315
+ * code : [github](https://github.com/zeke-xie/stable-weight-decay-regularization)
316
+ * paper : [arXiv](https://arxiv.org/abs/2011.11152)
317
+
318
+ ### Explore-exploit learning rate schedule
319
+
320
+ | |
321
+ |-------------------------------------------------------------------------------------------------------------------|
322
+ | ![image](https://raw.githubusercontent.com/kozistr/pytorch_optimizer/main/assets/explore_exploit_lr_schedule.png) |
323
+
324
+ * code : [github](https://github.com/nikhil-iyer-97/wide-minima-density-hypothesis)
325
+ * paper : [arXiv](https://arxiv.org/abs/2003.03977)
326
+
327
+ ### Lookahead
328
+
329
+ `k` steps forward, 1 step back. `Lookahead` consisting of keeping an exponential moving average of the weights that is updated and substituted to the current weights every `k` lookahead steps (5 by default).
330
+
331
+ ### Chebyshev learning rate schedule
332
+
333
+ Acceleration via Fractal Learning Rate Schedules.
334
+
335
+ ### (Adaptive) Sharpness-Aware Minimization
336
+
337
+ Sharpness-Aware Minimization (SAM) simultaneously minimizes loss value and loss sharpness.
338
+ In particular, it seeks parameters that lie in neighborhoods having uniformly low loss.
339
+
340
+ ### On the Convergence of Adam and Beyond
341
+
342
+ Convergence issues can be fixed by endowing such algorithms with 'long-term memory' of past gradients.
343
+
344
+ ### Improved bias-correction in Adam
345
+
346
+ With the default bias-correction, Adam may actually make larger than requested gradient updates early in training.
347
+
348
+ ### Adaptive Gradient Norm Correction
349
+
350
+ Correcting the norm of a gradient in each iteration based on the adaptive training history of gradient norm.
351
+
352
+ ## Frequently asked questions
353
+
354
+ [here](./qa.md)
355
+
356
+ ## Citation
357
+
358
+ Please cite the original authors of optimization algorithms. You can easily find it in the above table!
359
+ If you use this software, please cite it below. Or you can get it from "cite this repository" button.
360
+
361
+ @software{Kim_pytorch_optimizer_optimizer_2021,
362
+ author = {Kim, Hyeongchan},
363
+ month = jan,
364
+ title = {{pytorch_optimizer: optimizer & lr scheduler & loss function collections in PyTorch}},
365
+ url = {https://github.com/kozistr/pytorch_optimizer},
366
+ version = {2.12.0},
367
+ year = {2021}
368
+ }
369
+
370
+ ## Maintainer
371
+
372
+ Hyeongchan Kim / [@kozistr](http://kozistr.tech/about)
373
+