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 856fa72 commit 5f68bcfCopy full SHA for 5f68bcf
pytorch_optimizer/ranger.py
@@ -162,7 +162,7 @@ def step(self, _: CLOSURE = None) -> LOSS:
162
buffered[2] = step_size
163
164
if group['weight_decay'] != 0:
165
- p_data_fp32.add_(-group['weight_decay'] * group['lr'], p_data_fp32)
+ p_data_fp32.add_(p_data_fp32, alpha=-group['weight_decay'] * group['lr'])
166
167
if n_sma > self.n_sma_threshold:
168
denom = exp_avg_sq.sqrt().add_(group['eps'])
0 commit comments