-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
463 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,12 @@ license: MIT License | |
## Installation | ||
|
||
```bash | ||
pip install -r https://hub.optuna.org/samplers/hebo/requirements.txt | ||
git clone [email protected]:huawei-noah/HEBO.git | ||
cd HEBO/HEBO | ||
pip install -e . | ||
# Install the dependencies. | ||
pip install optunahub hebo | ||
|
||
# NOTE: Below is optional, but pymoo must be installed after NumPy for faster HEBOSampler, | ||
# we run the following command to make sure that the compiled version is installed. | ||
pip install --upgrade pymoo | ||
``` | ||
|
||
## APIs | ||
|
@@ -59,11 +61,7 @@ def objective(trial: optuna.trial.Trial) -> float: | |
|
||
|
||
module = optunahub.load_module("samplers/hebo") | ||
sampler = module.HEBOSampler(search_space={ | ||
"x": optuna.distributions.FloatDistribution(-10, 10), | ||
"y": optuna.distributions.IntDistribution(-10, 10), | ||
}) | ||
# sampler = module.HEBOSampler() # Note: `search_space` is not required, and thus it works too. | ||
sampler = module.HEBOSampler() | ||
study = optuna.create_study(sampler=sampler) | ||
study.optimize(objective, n_trials=100) | ||
|
||
|
@@ -73,6 +71,19 @@ print(study.best_trial.params, study.best_trial.value) | |
See [`example.py`](https://github.com/optuna/optunahub-registry/blob/main/package/samplers/hebo/example.py) for a full example. | ||
![History Plot](images/hebo_optimization_history.png "History Plot") | ||
|
||
Note that it may slightly speed up the sampling routine by giving the search space directly to `HEBOSampler` since Optuna can skip the search space inference. | ||
For example, the instantiation of `HEBOSampler` above can be modified as follows: | ||
|
||
```python | ||
search_space={ | ||
"x": optuna.distributions.FloatDistribution(-10, 10), | ||
"y": optuna.distributions.IntDistribution(-10, 10), | ||
} | ||
sampler = module.HEBOSampler(search_space=search_space) | ||
``` | ||
|
||
However, users need to make sure that the provided search space and the search space defined in the objective function must be consistent. | ||
|
||
## Others | ||
|
||
HEBO is the winning submission to the [NeurIPS 2020 Black-Box Optimisation Challenge](https://bbochallenge.com/leaderboard). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
optuna | ||
optunahub | ||
hebo@git+https://github.com/huawei-noah/[email protected]#subdirectory=HEBO | ||
hebo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Bryon Tjanaka | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.