change to apex for better fp16 and multi-gpu support

This commit is contained in:
Deyu Fu committed 2018-12-11 17:13:58 -08:00
1 parent a3a3180c86
commit c8ea286048
6 files changed
+142 -169

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ class OptimizationTest(unittest.TestCase):
criterion = torch.nn.MSELoss(reduction='elementwise_mean')
# 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)