Hydra Sweeper plugin for Orion
Provides a mechanism for Hydra applications to use Orion algorithms for the optimization of the parameters of any experiment.
See website for more information
Install
pip install hydra-orion-sweeper
Search Space
Orion defines 5 different dimensions that can be used to define your search space.
uniform(low, high, [discrete=False, precision=4, shape=None, default_value=None])
loguniform(low, high, [discrete=False, precision=4, shape=None, default_value=None])
normal(loc, scale, [discrete=False, precision=4, shape=None, default_value=None])
choices(*options)
fidelity(low, high, base=2)
Fidelity is a special dimension that is used to represent the training time, you can think of it as the epoch dimension.
Documentation
For in-depth documentation about the plugin and its configuration options you should refer to Orion as the plugin configurations are simply passed through.
Example
Configuration
defaults:
- override hydra/sweeper: orion
hydra:
sweeper:
params:
a: "uniform(0, 1)"
b: "uniform(0, 1)"
experiment:
name: 'experiment'
version: '1'
algorithm:
type: random
config:
seed: 1
worker:
n_workers: -1
max_broken: 3
max_trials: 100
storage:
type: legacy
database:
type: pickleddb
host: 'database.pkl'
# Default values
a: 0
b: 0
Code
import hydra
from omegaconf import DictConfig
@hydra.main(config_path=".", config_name="config")
def main(cfg: DictConfig) -> float:
"""Simple main function"""
a = cfg.a
b = cfg.b
return float(a + b)
if __name__ == "__main__":
main()
Running
To run the hyper parameter optimization process you need to specify the --multirun argument.
python my_app.py --multirun
The search space can also be tweaked from the command line
python my_app.py --multirun batch_size=4,8,12,16 optimizer.name=Adam,SGD 'optimizer.lr="loguniform(0.001, 1.0)"'
Metadata
Release files for hydra-orion-sweeper 1.6.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hydra-orion-sweeper-1.6.4.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hydra_orion_sweeper-1.6.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.5 kB
Release files / hydra-orion-sweeper-1.6.4.tar.gz
| Download URL | hydra-orion-sweeper-1.6.4.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2632886a6424d61d71ab537f4ee4e9b6dfce565536e63bc8862ccb99ef2eb6a
|
|
BLAKE2b-256 checksum How to use checksums |
cf169f7ae23cd7ec5d05da29064925858fe475148fdc8f0017f2153d21fceda5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.18
|
Release files / hydra_orion_sweeper-1.6.4-py3-none-any.whl
| Download URL | hydra_orion_sweeper-1.6.4-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62dfb861b449a77e42150879e45430820fb2534487427949069f5fa8fb35d4f6
|
|
BLAKE2b-256 checksum How to use checksums |
9b3b4768e05225d8b8eb009cc82a70d3d76490f64297794fca174724e1b2f25f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.18
|