[pl_examples] default warmup steps=0 (#5316)

This commit is contained in:
Sam Shleifer
2020-06-26 15:03:41 -04:00
committed by GitHub
parent bf0d12c220
commit 5543b30aa6
6 changed files with 14 additions and 13 deletions

View File

@@ -3,6 +3,7 @@ import glob
import logging
import os
import time
import warnings
from collections import defaultdict
from pathlib import Path
from typing import Dict, List, Tuple
@@ -216,6 +217,8 @@ class SummarizationModule(BaseTransformer):
scheduler = get_linear_schedule_with_warmup(
self.opt, num_warmup_steps=self.hparams.warmup_steps, num_training_steps=t_total
)
if max(scheduler.get_last_lr()) > 0:
warnings.warn("All learning rates are 0")
self.lr_scheduler = scheduler
return dataloader