From 51efde54a907c85495263a980d253dcdb3e75209 Mon Sep 17 00:00:00 2001 From: lukovnikov Date: Sat, 9 Mar 2019 02:45:25 +0100 Subject: [PATCH] cos fix --- pytorch_pretrained_bert/optimization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_pretrained_bert/optimization.py b/pytorch_pretrained_bert/optimization.py index 84f329feae..a92adb4c56 100644 --- a/pytorch_pretrained_bert/optimization.py +++ b/pytorch_pretrained_bert/optimization.py @@ -69,7 +69,7 @@ class WarmupCosineSchedule(LRSchedule): return progress / self.warmup else: progress = (progress - self.warmup) / (1 - self.warmup) # progress after warmup - return 0.5 * (1. + torch.cos(math.pi * self.cycles * 2 * progress)) + return 0.5 * (1. + math.cos(math.pi * self.cycles * 2 * progress)) class WarmupConstantSchedule(LRSchedule):