secondmind-labs / trieste

A Bayesian optimization toolbox built on TensorFlow
Apache License 2.0
212 stars 42 forks source link

The example in the readme has import issues in v1.2 #784

Closed FrancoisGallard closed 7 months ago

FrancoisGallard commented 10 months ago

Describe the bug Some imports have changed

To reproduce Steps to reproduce the behaviour: Copy paste the code in the Readme.md file

from trieste.objectives import Branin, mk_observer
observer = mk_observer(Branin.objective)
initial_query_points = Branin.search_space.sample(5)
initial_data = observer(initial_query_points)
from trieste.models.gpflow import build_gpr, GaussianProcessRegression
gpflow_model = build_gpr(initial_data, Branin.search_space)
model = GaussianProcessRegression(gpflow_model)

This works:

from trieste.objectives.single_objectives import Branin
from trieste.objectives.utils import mk_observer
observer = mk_observer(Branin.objective)
initial_query_points = Branin.search_space.sample(5)
initial_data = observer(initial_query_points)
from trieste.models.gpflow import build_gpr, GaussianProcessRegression
hstojic commented 8 months ago

thank you for spotting this bit, we will fix that!

uri-granta commented 7 months ago

(Fixed in #768)