A simple but practical example of how to use Bayesian optimization with Gaussian processes to tune a neural network using PyTorch and GPyOpt.
Clone the repository then create the conda environment:
git clone git@github.com:maw501/bayopt-gps.git
cd bayopt-gps
conda env create -f environment.yml
In order to use the conda environment in a notebook run:
python -m ipykernel install --user --name=bayopt
The version of torch installed is CPU only and training takes a few minutes per epoch on 4 cores depending on the parameters chosen by the Bayesian optimization.
The data will be automatically downloaded when training is run for the first time and stored in a data directory under the root of the repository.
There is currently a notebook which walks through the training process and shows how to set-up the objective function: Using GPyOpt to tune a CNN on MNIST.