bouthilx / orion.algo.grid_search

A GridSearch plugin for Oríon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

orion.algo.grid_search

Grid Search


This `orion.algo`_ plugin was generated with Cookiecutter along with @Epistimio's cookiecutter-orion.algo template.

Features

  • TODO

Requirements

  • TODO

Installation

Install latest version of Oríon:

$ pip install orion

You can then install "orion.algo.grid_search" via `pip`_ from `PyPI`_:

$ pip install git+https://github.com/bouthilx/orion.algo.grid_search.git

Usage

To use the Grid Search algorithm you need to create a configuration file for Oríon. For example:

experiment:
  name: 'grid_search_demo'
  algorithms:
    gridsearch:
      n_points: 5

database:
  type: 'pickleddb'
  host: 'db.pkl'

You can then call orion in commandline and pass the configuration file to use the algo.

orion hunt --config grid.yaml ./tests/functional/demo/black_box.py -x~'uniform(-50, 50)'

The file ./tests/functional/demo/black_box.py can be found in source code of Oríon here: https://github.com/Epistimio/orion/blob/develop/tests/functional/demo/black_box.py.

You can also use it with the Python API

from orion.client import create_experiment


def function(x):
    """Evaluate partial information of a quadratic."""
    z = x - 34.56789
    return [{'name': 'objective', 'type': 'objective', 'value': 4 * z**2 + 23.4}]


experiment = create_experiment(
    name='grid_search_pyapi_demo',
    space={'x': 'uniform(-50, 50)'},
    algorithms={'gridsearch': {'n_points': 5}},
    storage={
        'database': {
            'type': 'pickleddb',
            'host': 'db.pkl'
        }
    })

experiment.workon(function)

print(experiment.stats)

See Oríon's documentation for more information on the python API: https://orion.readthedocs.io/en/stable/user/api.html#python-apis.

Contributing

Contributions are very welcome. Tests can be run with `tox`_, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the BSD-3-Clause license, "orion.algo.grid_search" is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

About

A GridSearch plugin for Oríon

License:Other


Languages

Language:Python 100.0%