add an example of ViT-B/16 and remove w_norm clipping in LAMB (#29)

This commit is contained in:
ver217
2021-11-18 23:45:09 +08:00
committed by GitHub
parent 3defa32aee
commit dbe62c67b8
10 changed files with 302 additions and 1 deletions

View File

@@ -94,7 +94,7 @@ class Lamb(Optimizer):
# * math.sqrt(bias_correction2) / bias_correction1
step_size = group['lr']
weight_norm = p.data.pow(2).sum().sqrt().clamp(0, 10)
weight_norm = p.data.pow(2).sum().sqrt()
adam_step = exp_avg / exp_avg_sq.sqrt().add(group['eps'])
if group['weight_decay'] != 0: