def get_scheduler(self, stage: str, optimizer) -> _Scheduler: scheduler_params = \ self.stages_config[stage].get("scheduler_params", {}) scheduler = SCHEDULERS.get_from_params(**scheduler_params, optimizer=optimizer) return scheduler
def _get_scheduler(*, optimizer, **params): key_value_flag = params.pop("_key_value", False) if key_value_flag: scheduler = {} for key, params_ in params.items(): scheduler[key] = ConfigExperiment._get_scheduler( optimizer=optimizer, **params_) else: scheduler = SCHEDULERS.get_from_params(**params, optimizer=optimizer) return scheduler
def _get_scheduler(*, optimizer, **params): key_value_flag = params.pop("_key_value", False) if key_value_flag: scheduler = {} for scheduler_key, scheduler_params in params.items(): scheduler[ scheduler_key] = ConfigExperiment._get_scheduler( # noqa: WPS437 optimizer=optimizer, **scheduler_params) else: scheduler = SCHEDULERS.get_from_params(**params, optimizer=optimizer) return scheduler