Skip to content

Commit 9c6fc28

Browse files
authored
Merge pull request #155 from kozistr/feature/avagrad-optimizer
[Feature] Implement AvaGrad optimizer
2 parents 45a435f + 6fc7608 commit 9c6fc28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+473
-358
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test:
1313

1414
check:
1515
black -S -l 119 --check pytorch_optimizer tests hubconf.py
16-
ruff pytorch_optimizer tests hubconf.py
16+
ruff check pytorch_optimizer tests hubconf.py
1717

1818
requirements:
1919
python -m poetry export -f requirements.txt --output requirements.txt --without-hashes

README.rst

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pytorch-optimizer
1616

1717
| **pytorch-optimizer** is optimizer & lr scheduler collections in PyTorch.
1818
| 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.
19-
| Currently, 47 optimizers, 6 lr schedulers are supported!
19+
| Currently, 48 optimizers, 6 lr schedulers are supported!
2020
|
2121
| Highly inspired by `pytorch-optimizer <https://github.com/jettify/pytorch-optimizer>`__.
2222
@@ -179,6 +179,10 @@ You can check the supported optimizers & lr schedulers.
179179
+--------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------+
180180
| SRMM | *Stochastic regularized majorization-minimization with weakly convex and multi-convex surrogates* | `github <https://github.com/HanbaekLyu/SRMM>`__ | `https://arxiv.org/abs/2201.01652 <https://arxiv.org/abs/2201.01652>`__ |
181181
+--------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------+
182+
| AvaGrad | *Domain-independent Dominance of Adaptive Methods* | `github <https://github.com/lolemacs/avagrad>`__ | `https://arxiv.org/abs/1912.01823 <https://arxiv.org/abs/1912.01823>`__ |
183+
+--------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------+
184+
| PCGrad | *Gradient Surgery for Multi-Task Learning* | `github <https://github.com/tianheyu927/PCGrad>`__ | `https://arxiv.org/abs/2001.06782 <https://arxiv.org/abs/2001.06782>`__ |
185+
+--------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------+
182186

183187
Useful Resources
184188
----------------
@@ -197,7 +201,7 @@ Also, most of the captures are taken from ``Ranger21`` paper.
197201
+------------------------------------------+---------------------------------------------+--------------------------------------------+
198202
| `Lookahead`_ | `Chebyshev learning rate schedule`_ | `(Adaptive) Sharpness-Aware Minimization`_ |
199203
+------------------------------------------+---------------------------------------------+--------------------------------------------+
200-
| `On the Convergence of Adam and Beyond`_ | `Gradient Surgery for Multi-Task Learning`_ | |
204+
| `On the Convergence of Adam and Beyond`_ | `Improved bias-correction in Adam`_ | `Adaptive Gradient Norm Correction`_ |
201205
+------------------------------------------+---------------------------------------------+--------------------------------------------+
202206

203207
Adaptive Gradient Clipping
@@ -291,7 +295,7 @@ Lookahead
291295
Chebyshev learning rate schedule
292296
--------------------------------
293297

294-
Acceleration via Fractal Learning Rate Schedules
298+
Acceleration via Fractal Learning Rate Schedules.
295299

296300
- paper : `arXiv <https://arxiv.org/abs/2103.01338v1>`__
297301

@@ -310,10 +314,16 @@ On the Convergence of Adam and Beyond
310314

311315
- paper : `paper <https://openreview.net/forum?id=ryQu7f-RZ>`__
312316

313-
Gradient Surgery for Multi-Task Learning
314-
----------------------------------------
317+
Improved bias-correction in Adam
318+
--------------------------------
319+
320+
| With the default bias-correction, Adam may actually make larger than requested gradient updates early in training.
321+
322+
- paper : `arXiv <https://arxiv.org/abs/2110.10828>`_
323+
324+
Adaptive Gradient Norm Correction
325+
---------------------------------
315326

316-
- paper : `paper <https://arxiv.org/abs/2001.06782>`__
317327

318328
Citations
319329
---------
@@ -358,7 +368,7 @@ Citations
358368

359369
`On the Convergence of Adam and Beyond <https://ui.adsabs.harvard.edu/abs/2019arXiv190409237R/exportcitation>`__
360370

361-
`Gradient surgery for multi-task learning <https://ui.adsabs.harvard.edu/abs/2020arXiv200106782Y/exportcitation>`__
371+
`Gradient surgery for multi-task learning <https://github.com/tianheyu927/PCGrad#reference>`__
362372

363373
`AdamD <https://ui.adsabs.harvard.edu/abs/2021arXiv211010828S/exportcitation>`__
364374

@@ -420,6 +430,8 @@ Citations
420430

421431
`SRMM <https://ui.adsabs.harvard.edu/abs/2022arXiv220101652L/exportcitation>`__
422432

433+
`AvaGrad <https://ui.adsabs.harvard.edu/abs/2019arXiv191201823S/exportcitation>`__
434+
423435
Citation
424436
--------
425437

docs/conf.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,19 @@
99
# If extensions (or modules to document with autodoc) are in another directory,
1010
# add these directories to sys.path here. If the directory is relative to the
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
1312
import os
1413
import sys
1514

1615
sys.path.insert(0, os.path.abspath('../'))
1716

18-
import sphinx_rtd_theme
19-
2017
# -- Project information -----------------------------------------------------
2118

2219
project = 'pytorch-optimizers'
2320
copyright = '2021, kozistr'
2421
author = 'kozistr'
2522

2623
# The full version, including alpha/beta/rc tags
27-
release = '2.2.1'
24+
release = '2.8.0'
2825

2926

3027
# -- General configuration ---------------------------------------------------
@@ -33,16 +30,16 @@
3330
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3431
# ones.
3532
extensions = [
36-
'sphinx_rtd_theme',
33+
# 'sphinx_rtd_theme',
3734
'sphinx.ext.autodoc',
3835
'sphinx.ext.napoleon',
39-
'sphinx.ext.doctest',
4036
'sphinx.ext.todo',
4137
'sphinx.ext.coverage',
4238
'sphinx.ext.mathjax',
43-
'sphinx.ext.ifconfig',
4439
'sphinx.ext.viewcode',
45-
'sphinx.ext.intersphinx',
40+
# 'sphinx.ext.autosummary',
41+
# 'sphinx.ext.ifconfig',
42+
# 'sphinx.ext.intersphinx',
4643
]
4744

4845
# Add any paths that contain templates here, relative to this directory.
@@ -59,7 +56,7 @@
5956
# The theme to use for HTML and HTML Help pages. See the documentation for
6057
# a list of builtin themes.
6158
#
62-
html_theme = 'sphinx_rtd_theme'
59+
html_theme = 'alabaster'
6360

6461
# Add any paths that contain custom static files (such as style sheets) here,
6562
# relative to this directory. They are copied after the builtin static files,

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to pytorch-optimizers's documentation!
6+
Welcome to pytorch-optimizers documentation!
77
==============================================
88

99
.. include:: ../README.rst

docs/optimizer_api.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,3 +432,11 @@ SRMM
432432

433433
.. autoclass:: pytorch_optimizer.SRMM
434434
:members:
435+
436+
.. _AvaGrad:
437+
438+
AvaGrad
439+
-------
440+
441+
.. autoclass:: pytorch_optimizer.AvaGrad
442+
:members:

0 commit comments

Comments
 (0)