From 9e2537091702a1d3acca24cc7fcf57991c9e5967 Mon Sep 17 00:00:00 2001 From: uri-granta <50578464+uri-granta@users.noreply.github.com> Date: Tue, 18 Jul 2023 13:52:13 +0100 Subject: [PATCH] Fix README code example (#768) Co-authored-by: Uri Granta --- README.md | 6 +++--- trieste/acquisition/__init__.py | 11 +++++++++++ trieste/objectives/__init__.py | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 76789879d8..39d4ea0545 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Trieste (pronounced tree-est) is a Bayesian optimization toolbox built on [Tenso ## Getting started -Here's a quick overview of the main components of a Bayesian optimization loop. For more details, see our [Documentation](https://secondmind-labs.github.io/trieste) where we have multiple [Tutorials](https://secondmind-labs.github.io/trieste/tutorials.html) covering both the basic functionalities of the toolbox, as well as more advanced usage. +Here's a quick overview of the main components of a Bayesian optimization loop. For more details, see our [Documentation](https://secondmind-labs.github.io/trieste) where we have multiple [Tutorials](https://secondmind-labs.github.io/trieste/tutorials.html) covering both the basic functionalities of the toolbox, as well as more advanced usage. Let's set up a synthetic black-box objective function we wish to minimize, for example, a popular Branin optimization function, and generate some initial data ```python @@ -42,7 +42,7 @@ initial_data = observer(initial_query_points) First step is to create a probabilistic model of the objective function, for example a Gaussian Process model ```python -from trieste.models import build_gpr, GaussianProcessRegression +from trieste.models.gpflow import build_gpr, GaussianProcessRegression gpflow_model = build_gpr(initial_data, Branin.search_space) model = GaussianProcessRegression(gpflow_model) @@ -59,7 +59,7 @@ Finally, we optimize the acquisition function using our model for a number of st ```python from trieste.bayesian_optimizer import BayesianOptimizer -bo = BayesianOptimizer(observer, search_space) +bo = BayesianOptimizer(observer, Branin.search_space) num_steps = 15 result = bo.optimize(num_steps, initial_data, model) query_point, observation, arg_min_idx = result.try_get_optimal_point() diff --git a/trieste/acquisition/__init__.py b/trieste/acquisition/__init__.py index b6413b39bb..57191bd065 100644 --- a/trieste/acquisition/__init__.py +++ b/trieste/acquisition/__init__.py @@ -95,6 +95,17 @@ UpdatablePenalizationFunction, VectorizedAcquisitionFunctionBuilder, ) +from .rule import ( + TURBO, + AcquisitionRule, + AsynchronousGreedy, + AsynchronousOptimization, + BatchHypervolumeSharpeRatioIndicator, + DiscreteThompsonSampling, + EfficientGlobalOptimization, + RandomSampling, + TrustRegion, +) from .sampler import ( ExactThompsonSampler, GumbelSampler, diff --git a/trieste/objectives/__init__.py b/trieste/objectives/__init__.py index 8d78ee9ef4..9d21b3408b 100644 --- a/trieste/objectives/__init__.py +++ b/trieste/objectives/__init__.py @@ -44,3 +44,4 @@ SingleObjectiveTestProblem, Trid10, ) +from .utils import mk_multi_observer, mk_observer