Skip to content

Commit 7e83655

Browse files
authored
Merge pull request #39 from kozistr/update/deps
[Deps] Update the dependencies
2 parents ec23e0f + 8585308 commit 7e83655

File tree

10 files changed

+197
-447
lines changed

10 files changed

+197
-447
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ['3.7', '3.8']
14+
python-version: ['3.7', '3.8', '3.9']
1515

1616
steps:
1717
- uses: actions/checkout@v2

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
python-version: 3.8
3535
- name: Install dependencies
3636
run: |
37-
python3 -m pip install -r requirements-dev.txt
37+
python3 -m pip install -r requirements.txt
3838
python3 -m pip install -U wheel twine
3939
- name: Build package
4040
run: |

Pipfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ url = "https://pypi.org/simple"
44
verify_ssl = false
55

66
[dev-packages]
7-
isort = "==5.9.3"
8-
black = "==21.9b0"
9-
pylint = "==2.11.1"
10-
twine = "==3.4.2"
7+
isort = "==5.10.1"
8+
black = "==21.11b1"
9+
pylint = "==3.0.0a4"
1110

1211
[packages]
13-
numpy = "==1.21.2"
14-
torch = "==1.9.1"
12+
numpy = "==1.21.4"
13+
torch = "==1.10.0"
1514

1615
[requires]
1716
python_version = "3"

Pipfile.lock

Lines changed: 164 additions & 385 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pytorch_optimizer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
from pytorch_optimizer.sgdp import SGDP
2121
from pytorch_optimizer.utils import clip_grad_norm, get_optimizer_parameters, normalize_gradient, unit_norm
2222

23-
__VERSION__ = '0.2.1'
23+
__VERSION__ = '0.2.2'

pytorch_optimizer/adabelief.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,9 @@ def step(self, closure: CLOSURE = None) -> LOSS:
161161
denom = (exp_avg_var.add_(group['eps']).sqrt() / math.sqrt(bias_correction2)).add_(group['eps'])
162162

163163
if not self.rectify:
164-
if group['adamd_debias_term']:
165-
step_size = group['lr']
166-
else:
167-
step_size = group['lr'] / bias_correction1
168-
164+
step_size = group['lr']
165+
if not group['adamd_debias_term']:
166+
step_size /= bias_correction1
169167
p.data.addcdiv_(exp_avg, denom, value=-step_size)
170168
else:
171169
buffered = group['buffer'][int(state['step'] % 10)]
@@ -189,10 +187,9 @@ def step(self, closure: CLOSURE = None) -> LOSS:
189187
/ (n_sma_max - 2)
190188
)
191189

192-
if group['adamd_debias_term']:
193-
step_size = rt
194-
else:
195-
step_size = rt / bias_correction1
190+
step_size = rt
191+
if not group['adamd_debias_term']:
192+
step_size /= bias_correction1
196193
elif self.degenerated_to_sgd:
197194
step_size = 1.0 / bias_correction1
198195
else:

pytorch_optimizer/diffrgrad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(
3333
weight_decay: float = 0.0,
3434
n_sma_threshold: int = 5,
3535
degenerated_to_sgd: bool = True,
36-
adamd_debias_term: bool = adamd_debias_term,
36+
adamd_debias_term: bool = False,
3737
eps: float = 1e-8,
3838
):
3939
"""Blend RAdam with DiffGrad

requirements-dev.txt

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,21 @@
1010

1111
-i https://pypi.org/simple
1212
--trusted-host pypi.org
13-
astroid==2.8.0; python_version ~= '3.6'
14-
black==21.9b0
15-
bleach==4.1.0; python_version >= '3.6'
16-
certifi==2021.5.30
17-
cffi==1.14.6
18-
charset-normalizer==2.0.6; python_version >= '3'
19-
click==8.0.1; python_version >= '3.6'
20-
colorama==0.4.4; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
21-
cryptography==3.4.8; python_version >= '3.6'
22-
docutils==0.17.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
23-
idna==3.2; python_version >= '3'
24-
importlib-metadata==4.8.1; python_version >= '3.6'
25-
isort==5.9.3
26-
jeepney==0.7.1; sys_platform == 'linux'
27-
keyring==23.2.1; python_version >= '3.6'
13+
astroid==2.6.6; python_version ~= '3.6'
14+
black==21.11b1
15+
click==8.0.3; python_version >= '3.6'
16+
isort==5.10.1
2817
lazy-object-proxy==1.6.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'
2918
mccabe==0.6.1
3019
mypy-extensions==0.4.3
31-
numpy==1.21.2
32-
packaging==21.0; python_version >= '3.6'
20+
numpy==1.21.4
3321
pathspec==0.9.0
34-
pkginfo==1.7.1
35-
platformdirs==2.3.0; python_version >= '3.6'
36-
pycparser==2.20; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
37-
pygments==2.10.0; python_version >= '3.5'
38-
pylint==2.11.1
39-
pyparsing==2.4.7; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
40-
readme-renderer==29.0
41-
regex==2021.9.24
42-
requests-toolbelt==0.9.1
43-
requests==2.26.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'
44-
rfc3986==1.5.0
45-
secretstorage==3.3.1; sys_platform == 'linux'
46-
six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
22+
platformdirs==2.4.0; python_version >= '3.6'
23+
pylint==3.0.0a4
24+
regex==2021.11.10
25+
setuptools==59.4.0; python_version >= '3.6'
4726
toml==0.10.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
48-
tomli==1.2.1; python_version >= '3.6'
49-
torch==1.9.1
50-
tqdm==4.62.3; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
51-
twine==3.4.2
52-
typing-extensions==3.10.0.2
53-
urllib3==1.26.7; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'
54-
webencodings==0.5.1
55-
wrapt==1.12.1
56-
zipp==3.5.0; python_version >= '3.6'
27+
tomli==1.2.2; python_version >= '3.6'
28+
torch==1.10.0
29+
typing-extensions==4.0.0; python_version >= '3.6'
30+
wrapt==1.12.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77

88
-i https://pypi.org/simple
99
--trusted-host pypi.org
10-
numpy==1.21.2
11-
torch==1.9.1
12-
typing-extensions==3.10.0.2
10+
numpy==1.21.4
11+
torch==1.10.0
12+
typing-extensions==4.0.0; python_version >= '3.6'

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def read_version() -> str:
3333
'Programming Language :: Python :: 3.6',
3434
'Programming Language :: Python :: 3.7',
3535
'Programming Language :: Python :: 3.8',
36+
'Programming Language :: Python :: 3.9',
3637
'Operating System :: OS Independent',
3738
'Topic :: Scientific/Engineering :: Artificial Intelligence',
3839
]
@@ -88,5 +89,5 @@ def read_version() -> str:
8889
zip_safe=True,
8990
include_package_data=True,
9091
project_urls=PROJECT_URLS,
91-
python_requires='>=3.7.0',
92+
python_requires='>=3.6.0',
9293
)

0 commit comments

Comments
 (0)