BO works based on gaussian process, so what is gaussian there? Can I use BO for binary classification task, for example neural network which has output with logistic activation and is minimizing binary cross entropy loss ? target is thus from binary distribution and the noise is not gaussian.

  • $\begingroup$ If your problem is poorly modeled by a GP, you might be able to improve the results by transforming the response or the inputs. Alternatively, you might be interested in the non-BO suggestions here stats.stackexchange.com/questions/193306/… $\endgroup$ – Sycorax Nov 5 '19 at 16:41

Yes, the prior of objective function evaluation in your hyperparameter space is modelled using a Gaussian Process, the target need not be continuous, or have gaussian noise so it seems that it would be appropriate in your case.

This assumes some smoothness of your loss function in the hyperparameter space. Similar hyperparameters will have similar evaluations of the loss function, but does not require that the target be continuous, or have gaussian noise.

To give an example, imagine you are an oil exploration company choosing where to take samples on a square oilfield (X,Y). You might not start with any particular idea where there is lots of oil in the field, and so your expectation of the volume of oil at every point may be the same gaussian distribution.

If you start drilling randomly in the upper left area of the square, finding a reasonably large volume of oil, you might expect points nearby to also have a similar amount of oil, so your posterior belief for these points will have a higher mean and lower variance than points very far away in the lower right area. If you then checked a point in the lower right area (maybe the expected improvement from this could be higher because of the high variance) and found a very low amount of oil, then your posterior belief for the amount of oil in lower right area will now have a lower mean and variance.

Bayesian optimisation of hyperparameters is carrying out a similar process - X,Y represent the hyperparameters of your model and amount of oil found represents the evaluation of your loss function.

Here is a link going into more technical detail:


Here is some details of using BO to tune hyperparameters for a Keras NN


Here is a code example of using BO on a classification task:


| cite | improve this answer | |
  • $\begingroup$ perfect, thanks! Do you maybe have an idea of something similar as github in python, but in R ? I can not find anything for BO for DL in R . $\endgroup$ – pikachu Nov 5 '19 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.