Comments (4)
We don't have a special API for that, but it's possible in HEBO with the observe
function. you just need to feed the configurations with observe
.
For example, let's say you want to minimize f(x) = x^2
, and you want to provide two initial guess x = 3
and x = -5
, then you can do it by the following code
import pandas as pd
from hebo.design_space import DesignSpace
from hebo.optimizers.hebo import HEBO
def obj_func(param):
return (param['x'].values**2).reshape(-1, 1)
space = DesignSpace().parse([{'name' : 'x', 'type' : 'num', 'lb': -10, 'ub' : 10}])
opt = HEBO(space)
initial_suggest = pd.DataFrame([{'x' : 3}, {'x' : -5}])
opt.observe(initial_suggest, obj_func(initial_suggest))
for i in range(3):
rec = opt.suggest()
opt.observe(rec, obj_func(rec))
print(opt.X)
from hebo.
It is not enough with observe
only. There must be suggest
before observe
.
The code should be modified as follows:
......
initial_suggest = pd.DataFrame([{'x' : 3}, {'x' : -5}])
initial_suggest = opt.suggest(n_suggestions=1, fix_input = initial_suggest)
opt.observe(initial_suggest, obj_func(initial_suggest))
......
from hebo.
Thank you for the reply.
I actually mean a set of fixed configurations to observe, not only initial configurations.
For instance, if we want to optimize "learning rate" from an arbitrary list : [1e-5, 3e-5, 6e-5, 7e-5, 4e-4, 5e-2, 8e-1],
how can I do it? I wonder because this list does not match any pattern from the possible design spaces.
Best,
Sebastian
from hebo.
Hello Sebastian,
For now I think the best option would consist in considering "lr" as an integer parameter with lower bound 1 and upper bound the size of your list L (so for L = [1e-5, 3e-5, 6e-5, 7e-5, 4e-4, 5e-2, 8e-1] it would be 6) and to make your blackbox convert the suggestion lr = i
to lr = L[i]
. Note that you could also use a categorical parameter to directly suggest an element of your list, but then HEBO would not be aware of the order relations among the "categories".
from hebo.
Related Issues (20)
- [BUG] Demo example fails to run HOT 2
- help on optimization restart HOT 2
- Update PyPI package to version 0.3.5 HOT 4
- Problem with pest synthetic problem HOT 1
- logging module does not work when using HEBO
- Issues with Cholesky decompositions on simple benchmark HOT 6
- missing library_file asap7.lib HOT 1
- HEBO class for constrained optimization
- Issues running the test_nap_hpo.py
- 期待AIRBO的更新 HOT 1
- Issues using aig_optimization task in MCBO HOT 5
- Typo in about: Developped should be Developed HOT 1
- Typo in hebo/optimizers/hebo.py: Incorrect Parameter axsi instead of axis HOT 1
- Issue with hebo/acq_optimizers/evolution_optimizer.py
- Superfluous LightGBM Dependency Apple Silicon Incompatible HOT 1
- ValueError in HEBO HOT 2
- Support for `numpy>=1.25` HOT 1
- abc_release_path.txt HOT 2
- mcbo test_aig_task.py error HOT 6
- Installation issue for Agent on java branch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hebo.