def _init_optimizer(self, optimizers): self.optimizers = optimizers # reinitilize schedulers self.schedulers = [] for optimizer in self.optimizers: util.set_opt_param(optimizer, 'initial_lr', self.opt.lr) util.set_opt_param(optimizer, 'weight_decay', self.opt.wd)
def set_learning_rate(lr): for optimizer in engine.model.optimizers: util.set_opt_param(optimizer, 'lr', lr)
def _init_optimizer(self, optimizers): self.optimizers = optimizers for optimizer in self.optimizers: util.set_opt_param(optimizer, 'initial_lr', self.opt.lr) util.set_opt_param(optimizer, 'weight_decay', self.opt.wd)
def set_learning_rate(lr): for optimizer in engine.model.optimizers: print('[i] set learning rate to {}'.format(lr)) util.set_opt_param(optimizer, 'lr', lr)