class gpr::bo::ParameterSearch

Overview

Ask-and-tell minimization of a noisy loss over a parameter box. More…

#include <gpr/bo/ParameterSearch.h>
 
class ParameterSearch {
public:
    // structs
 
    struct Incumbent;
    struct Model;
 
    // construction
 
    ParameterSearch(std::vector<ParameterBound> bounds, ParameterSearchConfig config = {});
 
    // methods
 
    int dimension() const;
    int observationCount() const;
    const ParameterSearchConfig& config() const;
    const std::vector<ParameterBound>& bounds() const;
    void observe(const ParameterObservation& observation);
    void observe(const Eigen::VectorXd& parameters, double loss);
    void observe(const Eigen::VectorXd& parameters, double loss, double noise_variance);
    std::vector<Eigen::VectorXd> propose(int count);
    ParameterSearchResult best();
    void predict(const Eigen::MatrixXd& parameters, Eigen::VectorXd& mean, Eigen::VectorXd& standard_deviation);
    void predictFeasibility(const Eigen::MatrixXd& parameters, Eigen::VectorXd& probability);
    const ScalarHyperparameters& hyperparameters();
};

Detailed Documentation

Ask-and-tell minimization of a noisy loss over a parameter box.

The caller evaluates the loss. observe() records one result, with its noise variance when the caller knows it, and propose() returns the next parameter vectors to run. The surrogate is a ScalarSurrogate on the unit cube, fitted to losses standardized to zero mean and unit variance.

propose(q) builds a batch with the constant liar heuristic of Ginsbourger, Le Riche and Carraro (2010): after each pick the surrogate is conditioned on a made-up observation at that point, whose value is the incumbent (the “CL-min” lie), and the acquisition is maximized again. The hyperparameters are not refitted on the lies. The q points can then be evaluated together, for example in one allocation.

An observation may carry a constraint value c(x), feasible when c(x) <= 0. A second scalar GP models c, and expected improvement is multiplied by the probability of feasibility P(c(x) <= 0), as in Gardner et al. (2014) and Gelbart, Snoek and Adams (2014). The feasibility model is a GP regression on the constraint value, or on labels -1 (feasible) and +1 (infeasible) when only the outcome is known. It is not a classification likelihood: with labels the probability is a heuristic score and is not calibrated.

With ParameterSearchConfig::noisy_objective the incumbent is the smallest posterior mean at the evaluated points instead of the smallest observed loss: the plug-in form of expected improvement for a noisy oracle, reviewed by Picheny, Wagner and Ginsbourger (2013). One lucky noisy run then does not set the bar every later candidate has to beat.

Methods

void observe(const ParameterObservation& observation)

Record one evaluated parameter vector.

The parameters are moved to the lattice of their axes and clamped to the box. Either every observation carries a noise variance or none does; a mixture throws std::invalid_argument. A run that produced no loss is recorded with a non-finite loss and a positive constraint: it informs the feasibility model only.

void observe(const Eigen::VectorXd& parameters, double loss)

Record a loss observed with the shared noise variance.

void observe(const Eigen::VectorXd& parameters, double loss, double noise_variance)

Record a loss observed with its own noise variance.

std::vector<Eigen::VectorXd> propose(int count)

Propose up to count parameter vectors to evaluate next.

Without observations the points are the next ones of a Halton sequence. Otherwise they maximize the acquisition one after the other under the constant liar. Before any feasible loss is known the acquisition is the probability of feasibility alone. Fewer than count vectors come back when the box holds fewer unevaluated lattice points.

The incumbent, its loss and the number of observations.

The incumbent is the feasible evaluated parameter vector with the smallest loss. With noisy_objective it is the one with the smallest posterior mean, and loss is that mean.

Parameters:

std::logic_error

without a feasible observation.

void predict(const Eigen::MatrixXd& parameters, Eigen::VectorXd& mean, Eigen::VectorXd& standard_deviation)

Surrogate prediction of the latent loss, in the units of the observed losses, at each row of parameters.

Parameters:

std::logic_error

without an observed loss.

void predictFeasibility(const Eigen::MatrixXd& parameters, Eigen::VectorXd& probability)

Probability of feasibility P(c(x) <= 0) at each row of parameters. One everywhere while no constraint value is observed.

Parameters:

std::logic_error

without observations.

const ScalarHyperparameters& hyperparameters()

Hyperparameters of the loss surrogate, on the unit cube and for the standardized loss.

Parameters:

std::logic_error

without an observed loss.