예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
    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