fix swag example for work with apex

This commit is contained in:
thomwolf
2018-12-13 13:35:59 +01:00
parent 0cf88ff084
commit 0f544625f4
3 changed files with 59 additions and 78 deletions

View File

@@ -35,7 +35,7 @@ class OptimizationTest(unittest.TestCase):
criterion = torch.nn.MSELoss()
# No warmup, constant schedule, no gradient clipping
optimizer = BertAdam(params=[w], lr=2e-1,
weight_decay_rate=0.0,
weight_decay=0.0,
max_grad_norm=-1)
for _ in range(100):
loss = criterion(w, target)