Skip to content

Commit

Permalink
Update HEBO
Browse files Browse the repository at this point in the history
  • Loading branch information
Alaya-in-Matrix committed Jul 25, 2022
1 parent 3b2b0cb commit 8fe5f8d
Show file tree
Hide file tree
Showing 41 changed files with 2,091 additions and 287 deletions.
12 changes: 11 additions & 1 deletion HEBO/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@ Summary | Ablation

## Installation

You can install HEBO from pypi by

```bash
python setup.py develop
pip install HEBO
```

You can also build from source code to obtain our latest update:

```bash
cd HEBO
pip install -e .
```


## Documentation

Online documentation can be seen [here](https://hebo.readthedocs.io/en/latest/)
Expand Down
2 changes: 2 additions & 0 deletions HEBO/doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ Features
optimisation
sklearn_tuner

model_cmp
mo_constrained.ipynb
alebo_demo.ipynb
pymoo_evolution
custom
sgmcmc

.. Indices and tables
.. ==================
Expand Down
106 changes: 50 additions & 56 deletions HEBO/doc/source/mo_constrained.ipynb

Large diffs are not rendered by default.

207 changes: 207 additions & 0 deletions HEBO/doc/source/model_cmp.ipynb

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions HEBO/doc/source/optimisation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@
"\n",
"We compare three BO algorithms:\n",
"- The basic BO with LCB acquisition\n",
"- HEBO where three acquisition functions are ensembled, with input warping and power transformation\n",
"- HEBO with parallel recommendation\n",
"- MACE where three acquisition functions are ensembled, with input warping and power transformation\n",
"- MACE with parallel recommendation\n",
"\n",
"We'll run BO with LCB firstly, we can see the interface is very simple"
]
Expand Down Expand Up @@ -187,7 +187,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We then run the sequential HEBO"
"We then run the sequential MACE"
]
},
{
Expand Down Expand Up @@ -219,12 +219,12 @@
}
],
"source": [
"hebo_seq = HEBO(space, model_name = 'gpy', rand_sample = 4)\n",
"mace_seq = HEBO(space, model_name = 'gpy', rand_sample = 4)\n",
"for i in range(64):\n",
" rec_x = hebo_seq.suggest(n_suggestions=1)\n",
" hebo_seq.observe(rec_x, obj(rec_x))\n",
" rec_x = mace_seq.suggest(n_suggestions=1)\n",
" mace_seq.observe(rec_x, obj(rec_x))\n",
" if i % 4 == 0:\n",
" print('Iter %d, best_y = %.2f' % (i, hebo_seq.y.min()))"
" print('Iter %d, best_y = %.2f' % (i, mace_seq.y.min()))"
]
},
{
Expand Down Expand Up @@ -263,11 +263,11 @@
}
],
"source": [
"hebo_batch = HEBO(space, model_name = 'gpy', rand_sample = 4)\n",
"mace_batch = HEBO(space, model_name = 'gpy', rand_sample = 4)\n",
"for i in range(16):\n",
" rec_x = hebo_batch.suggest(n_suggestions=8)\n",
" hebo_batch.observe(rec_x, obj(rec_x))\n",
" print('Iter %d, best_y = %.2f' % (i, hebo_batch.y.min()))"
" rec_x = mace_batch.suggest(n_suggestions=8)\n",
" mace_batch.observe(rec_x, obj(rec_x))\n",
" print('Iter %d, best_y = %.2f' % (i, mace_batch.y.min()))"
]
},
{
Expand All @@ -276,16 +276,16 @@
"metadata": {},
"outputs": [],
"source": [
"conv_hebo_batch = np.minimum.accumulate(hebo_batch.y)\n",
"conv_hebo_seq = np.minimum.accumulate(hebo_seq.y)\n",
"conv_mace_batch = np.minimum.accumulate(mace_batch.y)\n",
"conv_mace_seq = np.minimum.accumulate(mace_seq.y)\n",
"conv_bo_seq = np.minimum.accumulate(bo.y)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We plot the converge below, we can see it seems that the LCB converges slightly faster than HEBO, while batched HEBO used most function evaluations"
"We plot the converge below, we can see it seems that the LCB converges slightly faster than MACE, while batched MACE used most function evaluations"
]
},
{
Expand Down Expand Up @@ -318,8 +318,8 @@
],
"source": [
"plt.figure(figsize = (8,6))\n",
"plt.semilogy(conv_hebo_batch - problem.ideal_point(), 'x-',label = 'HEBO, Parallel,Batch = 8')\n",
"plt.semilogy(conv_hebo_seq - problem.ideal_point(), 'x-',label = 'HEBO, Sequential')\n",
"plt.semilogy(conv_mace_batch - problem.ideal_point(), 'x-',label = 'MACE, Parallel,Batch = 8')\n",
"plt.semilogy(conv_mace_seq - problem.ideal_point(), 'x-',label = 'MACE, Sequential')\n",
"plt.semilogy(conv_bo_seq - problem.ideal_point(), 'x-',label = 'BO, LCB')\n",
"\n",
"plt.xlabel('Evaluation')\n",
Expand All @@ -331,7 +331,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Batched HEBO used most function evaluations because it recommend eight points per iterations, we can also plot the converge against **iterations** instead of **evaluations**"
"Batched MACE used most function evaluations because it recommend eight points per iterations, we can also plot the converge against **iterations** instead of **evaluations**"
]
},
{
Expand Down Expand Up @@ -364,8 +364,8 @@
],
"source": [
"plt.figure(figsize = (8,6))\n",
"plt.semilogy(conv_hebo_batch[::8] - problem.ideal_point(), 'x-',label = 'HEBO, Parallel,Batch = 8')\n",
"plt.semilogy(conv_hebo_seq - problem.ideal_point(), 'x-',label = 'HEBO, Sequential')\n",
"plt.semilogy(conv_mace_batch[::8] - problem.ideal_point(), 'x-',label = 'MACE, Parallel,Batch = 8')\n",
"plt.semilogy(conv_mace_seq - problem.ideal_point(), 'x-',label = 'MACE, Sequential')\n",
"plt.semilogy(conv_bo_seq - problem.ideal_point(), 'x-',label = 'BO, LCB')\n",
"\n",
"plt.xlabel('Iterations')\n",
Expand All @@ -377,7 +377,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can see that parallel HEBO converges much faster"
"We can see that parallel MACE converges much faster"
]
}
],
Expand Down
104 changes: 55 additions & 49 deletions HEBO/doc/source/pymoo_evolution.ipynb

Large diffs are not rendered by default.

401 changes: 401 additions & 0 deletions HEBO/doc/source/sgld_cpe.ipynb

Large diffs are not rendered by default.

424 changes: 424 additions & 0 deletions HEBO/doc/source/sgmcmc.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 8fe5f8d

Please sign in to comment.