Skip to content

Commit 1204ca7

Browse files
committed
update: validate min_lr
1 parent b3f7b42 commit 1204ca7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pytorch_optimizer/optimizer/ranger21.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def __init__( # pylint: disable=R0913
123123

124124
def validate_parameters(self):
125125
self.validate_learning_rate(self.lr)
126+
self.validate_learning_rate(self.min_lr)
126127
self.validate_betas(self.betas)
127128
self.validate_beta0(self.beta0)
128129
self.validate_weight_decay(self.weight_decay)
@@ -169,7 +170,7 @@ def warm_up_dampening(self, lr: float, step: int) -> float:
169170

170171
return new_lr
171172

172-
def get_warm_down(self, lr: float, iteration: int) -> float:
173+
def warm_down(self, lr: float, iteration: int) -> float:
173174
if iteration < self.start_warm_down:
174175
return lr
175176

@@ -269,7 +270,7 @@ def step(self, closure: CLOSURE = None) -> LOSS:
269270
lr = self.warm_up_dampening(lr, step)
270271

271272
# warm down
272-
lr = self.get_warm_down(lr, step)
273+
lr = self.warm_down(lr, step)
273274

274275
# stable decay
275276
decay = group['weight_decay']

0 commit comments

Comments
 (0)