diff --git a/dependencies/required.txt b/dependencies/required.txt index 30648ae58..75392a785 100644 --- a/dependencies/required.txt +++ b/dependencies/required.txt @@ -2,7 +2,6 @@ astor cloudpickle colorama filelock -hyperopt == 0.1.2 json_tricks >= 3.15.5 numpy < 1.22 ; python_version < "3.8" numpy ; python_version >= "3.8" diff --git a/dependencies/required_extra.txt b/dependencies/required_extra.txt index 244642492..fd8450bca 100644 --- a/dependencies/required_extra.txt +++ b/dependencies/required_extra.txt @@ -1,6 +1,9 @@ # the following content will be read by setup.py. # please follow the logic in setup.py. +# Anneal +hyperopt == 0.1.2 + # SMAC ConfigSpaceNNI>=0.4.7.3 smac4nni diff --git a/docs/source/hpo/tuners.rst b/docs/source/hpo/tuners.rst index 612d0b08b..a8528502f 100644 --- a/docs/source/hpo/tuners.rst +++ b/docs/source/hpo/tuners.rst @@ -77,6 +77,8 @@ Built-in Tuners - Heuristic - This simple annealing algorithm begins by sampling from the prior, but tends over time to sample from points closer and closer to the best ones observed. This algorithm is a simple variation on the random search that leverages smoothness in the response surface. The annealing rate is not adaptive. + Notice, Anneal needs to be installed by ``pip install nni[Anneal]`` command. + * - :class:`Evolution ` - Heuristic - Naive Evolution comes from Large-Scale Evolution of Image Classifiers. It randomly initializes a population-based on search space. For each generation, it chooses better ones and does some mutation (e.g., change a hyperparameter, add/remove one layer) on them to get the next generation. Naïve Evolution requires many trials to work, but it's very simple and easy to expand new features. `Reference paper `__ diff --git a/nni/algorithms/hpo/hyperopt_tuner.py b/nni/algorithms/hpo/hyperopt_tuner.py index 91dac9743..6f6b396f6 100644 --- a/nni/algorithms/hpo/hyperopt_tuner.py +++ b/nni/algorithms/hpo/hyperopt_tuner.py @@ -198,6 +198,12 @@ class HyperoptTuner(Tuner): This algorithm is a simple variation of random search that leverages smoothness in the response surface. The annealing rate is not adaptive. + Note that it needs additional installation using the following command: + + .. code-block:: bash + + pip install nni[Anneal] + Examples -------- diff --git a/setup.py b/setup.py index d31b9b0aa..d960cebca 100644 --- a/setup.py +++ b/setup.py @@ -121,6 +121,7 @@ def _setup(): python_requires = '>=3.7', install_requires = _read_requirements_txt('dependencies/required.txt'), extras_require = { + 'Anneal': _read_requirements_txt('dependencies/required_extra.txt', 'Anneal'), 'SMAC': _read_requirements_txt('dependencies/required_extra.txt', 'SMAC'), 'BOHB': _read_requirements_txt('dependencies/required_extra.txt', 'BOHB'), 'PPOTuner': _read_requirements_txt('dependencies/required_extra.txt', 'PPOTuner'),