From 66a84b63b08692c9da0302c7c9c3848efc125c50 Mon Sep 17 00:00:00 2001 From: lukovnikov Date: Wed, 27 Feb 2019 16:38:00 +0100 Subject: [PATCH] added warning --- pytorch_pretrained_bert/optimization.py | 2 +- pytorch_pretrained_bert/optimization_openai.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pytorch_pretrained_bert/optimization.py b/pytorch_pretrained_bert/optimization.py index 7d426f23ba..a6248374aa 100644 --- a/pytorch_pretrained_bert/optimization.py +++ b/pytorch_pretrained_bert/optimization.py @@ -83,7 +83,7 @@ class BertAdam(Optimizer): max_grad_norm=max_grad_norm) super(BertAdam, self).__init__(params, defaults) # warning for t_total exceeded - self._warned_for_t_total_at_progress = -1 if schedule == "warmup_linear" else float("inf") + self._warned_for_t_total_at_progress = -1 if schedule == "warmup_linear" else float("inf") # warning is not active with other schedules (since it doesn't break them) def get_lr(self): lr = [] diff --git a/pytorch_pretrained_bert/optimization_openai.py b/pytorch_pretrained_bert/optimization_openai.py index c609d5c242..80d496adf0 100644 --- a/pytorch_pretrained_bert/optimization_openai.py +++ b/pytorch_pretrained_bert/optimization_openai.py @@ -72,7 +72,7 @@ class OpenAIAdam(Optimizer): max_grad_norm=max_grad_norm) super(OpenAIAdam, self).__init__(params, defaults) # warning for t_total exceeded - self._warned_for_t_total_at_progress = -1 if schedule == "warmup_linear" else float("inf") + self._warned_for_t_total_at_progress = -1 if schedule == "warmup_linear" else float("inf") # warning is not active with other schedules (since it doesn't break them) def get_lr(self): lr = []