Tutorial page on how to use Bayesian Optimisation using BoTorch framework for the Bayesian Away day on the 15/07/2026 at University of Liverpool. The aim of these tutorials is to showcase the capabilities of existing libraries and guide the user over some simple steps on how to implement a solution themselves.
In the jupiter notebook tutorial_1 we present a simple optimisation problem using Gaussian processes and bayesian optimisation to identify the global minima of a distribution.
The second notebook tutorial_2, instead, explores further multi-dimensional problems of optimisation, including introduction of constraints on parameters and multi-objective problems.
For further help we suggest using the tutorials and material present on BoTorch website and Ax which is the adaptive experimentation platform (testing and applying BoTorch at scale).
To install and use the software in a clean environment you can create a virtual environment by doing:
python3 -m venv <name_of_venv>source <name_of_venv>/bin/activate.\<name_of_venv>\Scripts\activateEnsure that pip is up to date before installing dependencies:
python -m pip install --upgrade pipThen you can install the latest version from the GitHub repository:
python -m pip install git+https://github.com/UoL-SignalProcessingGroup/Bay_opt_tutorial.gitAlternatively, if you are developing the project locally...
python -m pip install -e .[dev]To check that the project is installed propertly please run:
import torch
from botorch.test_functions.multi_objective import C2DTLZ2
# test torch is installed correctly -> torch.size([100])
x = torch.linspace(0, 1, 100)
print(x.shape)
# test the botorch is installed
tkwargs = {
"dtype": torch.double,
"device": torch.device("cuda:3" if torch.cuda.is_available() else "cpu"),
}
d = 2
M = 1
problem = C2DTLZ2(dim=d, num_objectives=M, negate=True).to(**tkwargs)
print(problem) # --> C2DTLZ2()