Skip to content

Commit 7df2167

Browse files
committed
update: test_ranger21_methods
1 parent e9ae9dc commit 7df2167

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/test_optimizer_parameters.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pytest
44
from torch import nn
55

6-
from pytorch_optimizer import SAM, AdamP, Lookahead, PCGrad, SafeFP16Optimizer, load_optimizers
6+
from pytorch_optimizer import SAM, AdamP, Lookahead, PCGrad, SafeFP16Optimizer, load_optimizers, Ranger21
77
from tests.utils import Example
88

99
OPTIMIZER_NAMES: List[str] = [
@@ -173,3 +173,11 @@ def test_safe_fp16_methods():
173173
optimizer.set_lr(lr=5e-1)
174174

175175
assert optimizer.loss_scale == 2.0 ** (15 - 1)
176+
177+
178+
def test_ranger21_methods():
179+
warm_up_iterations: int = Ranger21.build_warm_up_iterations(1000, 0.999)
180+
assert warm_up_iterations == 220
181+
182+
warm_down_iterations = Ranger21.build_warm_down_iterations(1000)
183+
assert warm_down_iterations == 280

0 commit comments

Comments
 (0)