Skip to content

Commit 54220e2

Browse files
committed
replaced torch.finfo with explicit value
Signed-off-by: mikail <[email protected]>
1 parent f9f12bd commit 54220e2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

emerging_optimizers/psgd/psgd.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,7 @@ def _update_precond_procrustes(
200200
q_list: List of Kronecker factors.
201201
lip_const_list: List of Lipschitz constants for the Kronecker factors.
202202
"""
203-
dampened_momentum = exp_avg + (
204-
damping_noise_scale + torch.finfo(exp_avg.dtype).eps * exp_avg.abs()
205-
) * torch.randn_like(exp_avg)
203+
dampened_momentum = exp_avg + (damping_noise_scale + 1e-7 * exp_avg.abs()) * torch.randn_like(exp_avg)
206204
pg = apply_preconditioner(q_list, dampened_momentum)
207205
total_numel = pg.numel()
208206
updated_q_list: List[torch.Tensor] = []

0 commit comments

Comments
 (0)