We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e68698 commit 619c169Copy full SHA for 619c169
pytorch_optimizer/radam.py
@@ -152,7 +152,7 @@ def step(self, closure: CLOSURE = None) -> LOSS:
152
step_size = -1
153
buffered[2] = step_size
154
155
- if (n_sma >= self.n_sma_threshold or step_size > 0) and group['weight_decay'] != 0:
+ if group['weight_decay'] != 0 and (n_sma >= self.n_sma_threshold or step_size > 0):
156
p_fp32.add_(p_fp32, alpha=-group['weight_decay'] * group['lr'])
157
158
if n_sma >= self.n_sma_threshold:
0 commit comments