File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,20 @@ def __init__(
2222 grokfast = True ,
2323 grokfast_alpha = 0.98 ,
2424 grokfast_lamb = 2. ,
25- grokfast_after_step = 0
25+ grokfast_after_step = 0 ,
26+ normalize_lr = True
2627 ):
2728 assert lr > 0.
2829 assert all ([0. <= beta <= 1. for beta in betas ])
2930 assert weight_decay >= 0.
3031 assert eps > 0.
3132
33+ # in order for fair comparison
34+ # reduce the learning rate by a factor of (1 + grokfast_lamb)
35+
36+ if normalize_lr :
37+ lr /= (1. + grokfast_lamb )
38+
3239 self ._init_lr = lr
3340
3441 defaults = dict (
Original file line number Diff line number Diff line change 11[project ]
22name = " grokfast-pytorch"
3- version = " 0.0.3 "
3+ version = " 0.0.4 "
44description = " Grokfast"
55authors = [
66 { name = " Phil Wang" , email = " lucidrains@gmail.com" }
You can’t perform that action at this time.
0 commit comments