From e9533a3720ba5196f60c2db7c088ee10569dab74 Mon Sep 17 00:00:00 2001 From: DrMatters Date: Fri, 10 Dec 2021 15:19:11 +0300 Subject: [PATCH 1/4] Fix a typo in parameter name --- tests/test_lr_schedulers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_lr_schedulers.py b/tests/test_lr_schedulers.py index 9092d83c8ae..2d9e83f90e9 100644 --- a/tests/test_lr_schedulers.py +++ b/tests/test_lr_schedulers.py @@ -202,7 +202,7 @@ def _test_scheduler(self, **kwargs): ) assert logs_first[20]['lr'] == logs_second[0]['lr'] - if 'warump_updates' in kwargs: + if 'warmup_updates' in kwargs: full_logs = logs_first[:20] + logs_second assert full_logs[kwargs['warmup_updates']]['lr'] == 1.0 From 3bfe2c313358be67ae266f0903d4d31811fa77d4 Mon Sep 17 00:00:00 2001 From: DrMatters Date: Sun, 12 Dec 2021 11:20:48 +0300 Subject: [PATCH 2/4] Oh, you can fix 2 failed test out of 8 by changing a single symbol --- parlai/nn/lr_scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parlai/nn/lr_scheduler.py b/parlai/nn/lr_scheduler.py index ffc5a43f892..ab1383ba7d3 100644 --- a/parlai/nn/lr_scheduler.py +++ b/parlai/nn/lr_scheduler.py @@ -86,7 +86,7 @@ def _is_lr_warming_up(self): return ( hasattr(self, 'warmup_scheduler') and self.warmup_scheduler is not None - and self._number_training_updates < self.warmup_updates + and self._number_training_updates <= self.warmup_updates ) def _warmup_lr(self, step): From 3b1c824b3418aa5c709d3a26f4936012bd2258bc Mon Sep 17 00:00:00 2001 From: DrMatters Date: Sun, 12 Dec 2021 13:45:53 +0300 Subject: [PATCH 3/4] Fix integration tests --- tests/test_lr_schedulers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_lr_schedulers.py b/tests/test_lr_schedulers.py index 2d9e83f90e9..f02cd9c9297 100644 --- a/tests/test_lr_schedulers.py +++ b/tests/test_lr_schedulers.py @@ -204,7 +204,7 @@ def _test_scheduler(self, **kwargs): if 'warmup_updates' in kwargs: full_logs = logs_first[:20] + logs_second - assert full_logs[kwargs['warmup_updates']]['lr'] == 1.0 + assert full_logs[kwargs['warmup_updates'] - 1]['lr'] == 1.0 return logs_first, logs_second From af0eda66fffeca0117dba6bde0646d81bbd3d123 Mon Sep 17 00:00:00 2001 From: DrMatters Date: Sun, 12 Dec 2021 14:13:45 +0300 Subject: [PATCH 4/4] Oh, you can fix 2 failed test out of 8 by changing a single symbol --- parlai/nn/lr_scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parlai/nn/lr_scheduler.py b/parlai/nn/lr_scheduler.py index ab1383ba7d3..0a740c6e235 100644 --- a/parlai/nn/lr_scheduler.py +++ b/parlai/nn/lr_scheduler.py @@ -86,7 +86,7 @@ def _is_lr_warming_up(self): return ( hasattr(self, 'warmup_scheduler') and self.warmup_scheduler is not None - and self._number_training_updates <= self.warmup_updates + and self.warmup_scheduler.get_last_lr()[0] < 1.0 ) def _warmup_lr(self, step):