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

Add MOFA #864

Merged
merged 28 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6120850
Add MOFA
wagnersj Mar 28, 2022
f56365a
Removed whitespace
wagnersj Mar 28, 2022
a3fd706
Black reformatting
wagnersj Mar 29, 2022
94d2c3f
Update src/orion/algo/mofa/mofa.py
wagnersj Mar 29, 2022
ae7822b
Update src/orion/algo/mofa/mofa.py
wagnersj Mar 29, 2022
5ce6434
Update src/orion/algo/mofa/mofa.py
wagnersj Mar 29, 2022
63f1ad8
Update src/orion/algo/mofa/mofa.py
wagnersj Mar 29, 2022
8e12929
MOFA sampler un-classed
wagnersj Mar 30, 2022
cfc54bf
Merge branch 'feature/mofa' of github.com:wagnersj/orion into feature…
wagnersj Mar 30, 2022
ee7139c
New space initialization
wagnersj Mar 31, 2022
d26d8bc
Merge remote-tracking branch 'upstream/develop' into feature/mofa
wagnersj Mar 31, 2022
2dc8a3c
Updated retrieval of existing trails from registry
wagnersj Mar 31, 2022
268378e
Remove version file from MOFA
wagnersj Apr 1, 2022
b3f58ef
Added typing
wagnersj Apr 4, 2022
4d686c7
Fixed typing
wagnersj Apr 4, 2022
143ac15
Merge remote-tracking branch 'upstream/develop' into feature/mofa
wagnersj Apr 4, 2022
dde480d
Update test phases and naming
wagnersj Apr 4, 2022
8a3e174
Added MOFA paper ref
wagnersj Apr 4, 2022
68d60e6
Merge remote-tracking branch 'upstream/develop' into feature/mofa
wagnersj Apr 27, 2022
710af4d
Fix doc8 issue
wagnersj Apr 27, 2022
c69ff3a
Fixed docs problems for MOFA
wagnersj May 4, 2022
1f7df22
Merge remote-tracking branch 'upstream/develop' into feature/mofa
wagnersj May 4, 2022
9f9eb67
Fixed function typing issues with py38
wagnersj May 10, 2022
1d5401a
Skip python 3.7 tests
wagnersj May 10, 2022
f32e89b
Check scipy version
wagnersj May 11, 2022
c16c1d3
Fixed classmethod bug
wagnersj May 18, 2022
13b2683
Merge remote-tracking branch 'upstream/develop' into feature/mofa
wagnersj May 18, 2022
6f86b66
Merge branch 'develop' into feature/mofa
bouthilx May 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ requirements:
- scikit-learn
- psutil
- pytest >=3.0.0
- scikit-optimize

test:
import:
Expand Down
1 change: 1 addition & 0 deletions docs/src/code/algo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Algorithm modules
algo/pbt
algo/pb2
algo/tpe
algo/mofa
algo/nevergrad
algo/parallel_strategy
algo/registry
Expand Down
5 changes: 5 additions & 0 deletions docs/src/code/algo/mofa.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MOFA Algorithm
===================

.. automodule:: orion.algo.mofa.mofa
:members:
1 change: 1 addition & 0 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
"plotly": ("https://plotly.com/python-api-reference/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"torch": ("https://pytorch.org/docs/stable/", None),
"pandas": ("https://pandas.pydata.org/docs/", None)
}


Expand Down
51 changes: 50 additions & 1 deletion docs/src/user/algorithms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,56 @@ Configuration
requires_dist, requires_type


.. _mofa algorithm:

MOFA
-----

The MOdular FActorial Design (`MOFA`_) algorithm is based on factorial design and factorial
analysis methods to optmimize hyperparameters. It performs multiple iterations each of which
starts with sampling hyperparameter trial values from an orthogonal latin hypercube to cover
the search space well while de-correlating hyperparameters. Once all trials in an iteration
are returned, MOFA performs factorial analysis to determine which hyperparameters should be
fixed in value and which hyperparameters require further exploration. As the hyperparameters
become fixed, the number of trials are reduced in subsequent iterations.

.. _MOFA: https://arxiv.org/abs/2011.09545

.. note::

MOFA requires Python v3.8 or greater and scipy v1.8 or greater.

.. note::

Default values for the ``index``, ``n_levels``, and ``strength`` parameters are set
to the empirically obtained optimal values described in section 5.2 of the paper.
The ``strength`` parameter must be set to either ``1`` or ``2``.

.. note::

The number of trials N for a single MOFA iteration is set to ``N = index * n_levels^strength``.
The ``--exp-max-trials`` should at least be a multiple of ``N``.

Configuration
~~~~~~~~~~~~~

.. code-block:: yaml

experiment:
algorithms:
MOFA:
seed: null
index: 1
n_levels: 5
strength: 2
threshold: 0.1

.. autoclass:: orion.algo.mofa.mofa.MOFA
:noindex:
:exclude-members: space, state_dict, set_state, suggest, observe, is_done, seed_rng,
requires_dist, requires_type


.. _nevergrad-algorithm:


Expand All @@ -554,7 +604,6 @@ a library of algorithms for hyperparameter search.

.. _nevergrad: https://facebookresearch.github.io/nevergrad/


.. code-block:: yaml

experiment:
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

packages = [ # Packages must be sorted alphabetically to ease maintenance and merges.
"orion.algo",
"orion.algo.mofa",
"orion.algo.dehb",
"orion.algo.pbt",
"orion.analysis",
Expand Down Expand Up @@ -90,6 +91,7 @@
"tpe = orion.algo.tpe:TPE",
"EvolutionES = orion.algo.evolution_es:EvolutionES",
"pbt = orion.algo.pbt.pbt:PBT",
"mofa = orion.algo.mofa.mofa:MOFA",
"pb2 = orion.algo.pbt.pb2:PB2",
"bohb = orion.algo.bohb:BOHB",
"nevergrad = orion.algo.nevergradoptimizer:NevergradOptimizer",
Expand Down Expand Up @@ -130,6 +132,7 @@
"psutil",
"joblib",
"pytest>=3.0.0",
"scikit-optimize",
],
tests_require=tests_require,
setup_requires=["setuptools", "appdirs", "pytest-runner"],
Expand Down Expand Up @@ -159,7 +162,7 @@
"Programming Language :: Python",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
] + [("Programming Language :: Python :: %s" % x) for x in "3 3.7 3.8 3.9".split()]
] + [("Programming Language :: Python :: %s" % x) for x in "3 3.8 3.9".split()]

if __name__ == "__main__":
setup(**setup_args)
Loading