From 7cdd164d7775c444ee50afa6b825c843038f1b07 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Mon, 21 Mar 2022 13:35:45 -0700 Subject: [PATCH] Fix #1184, scheduler noise bug during merge madness --- timm/scheduler/scheduler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/timm/scheduler/scheduler.py b/timm/scheduler/scheduler.py index 81af76f9..e7a6d2a7 100644 --- a/timm/scheduler/scheduler.py +++ b/timm/scheduler/scheduler.py @@ -92,6 +92,7 @@ class Scheduler: def _is_apply_noise(self, t) -> bool: """Return True if scheduler in noise range.""" + apply_noise = False if self.noise_range_t is not None: if isinstance(self.noise_range_t, (list, tuple)): apply_noise = self.noise_range_t[0] <= t < self.noise_range_t[1] @@ -104,7 +105,7 @@ class Scheduler: g.manual_seed(self.noise_seed + t) if self.noise_type == 'normal': while True: - # resample if noise out of percent limit, brute force but shouldn't spin much + # resample if noise out of percent limit, brute force but shouldn't spin much noise = torch.randn(1, generator=g).item() if abs(noise) < self.noise_pct: return noise