From 341b464a5a8a9d8e9cff7ea5e17034d9955376e9 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Mon, 21 Mar 2022 22:00:03 -0700 Subject: [PATCH] Remove redundant noise attr from Plateau scheduler (use parent) --- timm/scheduler/plateau_lr.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/timm/scheduler/plateau_lr.py b/timm/scheduler/plateau_lr.py index fbfc531f..cacfab3c 100644 --- a/timm/scheduler/plateau_lr.py +++ b/timm/scheduler/plateau_lr.py @@ -30,7 +30,16 @@ class PlateauLRScheduler(Scheduler): noise_seed=None, initialize=True, ): - super().__init__(optimizer, 'lr', initialize=initialize) + super().__init__( + optimizer, + 'lr', + noise_range_t=noise_range_t, + noise_type=noise_type, + noise_pct=noise_pct, + noise_std=noise_std, + noise_seed=noise_seed, + initialize=initialize, + ) self.lr_scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau( self.optimizer, @@ -43,11 +52,6 @@ class PlateauLRScheduler(Scheduler): min_lr=lr_min ) - self.noise_range_t = noise_range_t - self.noise_pct = noise_pct - self.noise_type = noise_type - self.noise_std = noise_std - self.noise_seed = noise_seed if noise_seed is not None else 42 self.warmup_t = warmup_t self.warmup_lr_init = warmup_lr_init if self.warmup_t: @@ -84,7 +88,6 @@ class PlateauLRScheduler(Scheduler): if self._is_apply_noise(epoch): self._apply_noise(epoch) - def _apply_noise(self, epoch): noise = self._calculate_noise(epoch)