Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-scheduler support for multi-optimizer case #923

Merged
merged 1 commit into from
Aug 26, 2020

Conversation

bagxi
Copy link
Member

@bagxi bagxi commented Aug 25, 2020

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contribution guide?
  • Did you check the code style? catalyst-make-codestyle && catalyst-check-codestyle (pip install -U catalyst-codestyle).
  • Did you make sure to update the docs? We use Google format for all the methods and classes.
  • Did you check the docs with make check-docs?
  • Did you write any new necessary tests?
  • Did you add your new functionality to the docs?
  • Did you update the CHANGELOG?
  • You can use 'Login as guest' to see Teamcity build logs.

Description

Related Issue

Type of Change

  • Examples / docs / tutorials / contributors update
  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Comment on lines +355 to +369
def get_scheduler(
self, stage: str, optimizer: Union[Optimizer, Dict[str, Optimizer]]
) -> Union[Scheduler, Dict[str, Scheduler]]:
"""Returns the scheduler for a given stage."""
params = self.stages_config[stage].get("scheduler_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
scheduler: Dict[str, Scheduler] = {}
for key, scheduler_params in params.items():
scheduler[key] = self._get_scheduler(
optimizer=optimizer, **scheduler_params
)
else:
scheduler = SCHEDULERS.get_from_params(
**params, optimizer=optimizer
)
return scheduler
scheduler = self._get_scheduler(optimizer=optimizer, **params)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please provide an examples config for this case?

@Scitator Scitator merged commit 9a8724d into master Aug 26, 2020
@mergify mergify bot deleted the scheduler_key_value branch August 26, 2020 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants