-
Notifications
You must be signed in to change notification settings - Fork 52
Sweeper PR #214
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
base: main
Are you sure you want to change the base?
Sweeper PR #214
Changes from 5 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,67 @@ | ||||||||||||||
| import itertools | ||||||||||||||
| from collections import OrderedDict | ||||||||||||||
| from dataclasses import dataclass | ||||||||||||||
|
|
||||||||||||||
| from tango.common import Params, Registrable | ||||||||||||||
| from tango.common.testing import run_experiment | ||||||||||||||
|
|
||||||||||||||
| main_config_path = ( | ||||||||||||||
| "/Users/sabhyac/Desktop/sabhya/tango/test_fixtures/sweeps/basic_test/config.jsonnet" | ||||||||||||||
| ) | ||||||||||||||
| sweeps_config_path = ( | ||||||||||||||
| "/Users/sabhyac/Desktop/sabhya/tango/test_fixtures/sweeps/basic_test/sweeps-config.jsonnet" | ||||||||||||||
| ) | ||||||||||||||
| components = ( | ||||||||||||||
| "/Users/sabhyac/Desktop/sabhya/tango/test_fixtures/sweeps/basic_test/basic_arithmetic.py" | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| class Sweeper(Registrable): | ||||||||||||||
| def __init__(self, main_config_path: str, sweeps_config_path: str, components: str): | ||||||||||||||
|
||||||||||||||
| def __init__(self, main_config_path: str, sweeps_config_path: str, components: str): | |
| def __init__(self, main_config_path: str, sweeps_config_path: str, components: str, target_step: str, workspace: Workspace): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to start by implementing #142 in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In recent versions of Python you can just do this:
| super(Registrable, self).__init__() | |
| super().__init__() |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run_experiment is just for testing. We probably want to run our sweep experiments in subprocesses so that we can execute them in parallel. You could do something like this:
| main_config = self.override_hyperparameters(combination) | |
| # TODO: need to figure where & how to store results / way to track runs | |
| with run_experiment(main_config, include_package=[self.components]) as run_dir: | |
| # TODO: fill in something here? | |
| pass | |
| subprocess.call(["tango", "run", self.main_config_path, "--overrides", json.dumps(overrides)]) |
Of course this doesn't make anything run in parallel, but would be a good first step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| class SweepConfig(Params): | |
| class SweepConfig(FromParams): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See
Line 13 in 54c4a8d
| class TangoGlobalSettings(FromParams): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.