Particle learning of Gaussian process models for sequential design and optimization
Robert B. Gramacy, Nicholas G. Polson
Introduction
The Gaussian process (GP) is by now well established as the backbone of many highly flexible and effective nonlinear regression and classification models (e.g., Neal,, 1998; Rasmussen and Williams,, 2006). One important application for GPs is in the sequential design of computer experiments (Santner et al.,, 2003) where designs are built up iteratively: choose a new design point according to some criterion derived from a GP surrogate model fit; update the fit conditional on the new pair ; and repeat. The goal is to keep designs small in order to save on expensive simulations of . By “fit” we colloquially mean: samples obtained from the GP posterior via MCMC. While it is possible to choose each new design point via full utility-based design criterion (e.g., Müller et al.,, 2004), this can be computationally daunting even for modestly sized designs. More thrifty active learning (AL) criterion such as ALM (MacKay,, 1992) and ALC (Cohn,, 1996) can be an effective alternative. These were first used with GPs by Seo et al., (2000), and have since been paired with a non-stationary GP to design a rocket booster (Gramacy and Lee,, 2009).
Similar AL criteria are available for other sequential design tasks. Optimization by expected improvement (EI, Jones et al.,, 1998) is one example. Taddy et al., (2009) used an embellished EI with a non-stationary GP model and MCMC inference to determine the optimal robust configuration of a circuit device. In the classification setting, characteristics like the predictive entropy (Joshi et al.,, 2009) can be used to explore the boundaries between regions of differing class label in order to maximize the information obtained from each new . The thrifty nature of AL and the flexibility of the GP is a favorable marriage, indeed. However, a drawback of batch MCMC-based inference is that it is not tailored to the online nature of sequential design. Except to guide the initialization of a new Markov chain, it is not clear how fits from earlier iterations may re-used in search of the next . So after the design is augmented with the MCMC must be restarted and iterated to convergence.
In this paper we propose to use a sequential Monte Carlo (SMC) technique called particle learning (PL) to exploit the analytically tractable (and Rao–Blackwellizable) GP posterior predictive distribution in order to obtain a quick update of the GP fit after each sequential design iteration. We then show how some key AL heuristics may be efficiently calculated from the particle approximation. Taken separately, SMC/PL, GPs, and AL, are by now well established techniques in their own right. Our contribution lies in illustrating how together they can be a potent mixture for sequential design and optimization under uncertainty.
The remainder of the paper is outlined as follows. Section 1.1 describes the basic elements of GP modeling. Section 1.2 reviews SMC and PL, highlighting the strengths of PL in our setting. Section 2 develops a PL implementation for GP regression and classification, with illustrations and comparisons to MCMC. We show how fast updates of particle approximations may be used for AL in optimization and classification in Section 3, and we conclude with a discussion in Section 4. Software implementing our methods, and the specific code for our illustrative examples, is available in the plgp package (Gramacy,, 2010) for R on CRAN.
It is possible to use a vague scale-invariant prior () for . In this case, the marginal posterior (1) is proper as long as . Mixing is generally good for Metropolis–Hastings (MH) sampling as long as is parsimoniously parameterized, is large, and there is a high signal–to–noise ratio between and . Otherwise, the posterior can be multimodal (e.g., Warnes and Ripley,, 1987) and hard to sample.
Crucially for our SMC inference via PL [Section 2], and for our AL heuristics [Section 3], the fully marginalized predictive equations for GP regression are available in closed form. Specifically, the distribution of the response conditioned on data and covariance , i.e., , is Student- with degrees of freedom ,
where is the -vector whose component is .
In the classification problem, with data , where is a vector of class labels , the GP is used -fold as a prior over a collection of latent variables , one set for each class. For a particular class , the generative model (or prior) over the latent variables is MVN with mean and variance , as in the regression setup. The class labels then determine the likelihood through the latent variables under an independence assumption so that , where . Neal, (1998) recommends a softmax specification:
2 Sequential Monte Carlo
Sequential Monte Carlo (SMC) is an alternative to MCMC that is designed for online inference in dynamic models. In SMC, particles containing the sufficient information about all uncertainties given data up to time are used to approximate the posterior distribution: . In Section 2 we describe the sufficient information for our GP regression and classification models. The key task in SMC inference is to update the particle approximation from time to time .
Our preferred SMC updating method is particle learning (PL, e.g., Carvalho et al.,, 2008) due to the convenient form of the posterior predictive distribution of GP models. The PL update is derived from the following decomposition.
This suggests a two-step update of the particle approximation:
resample the indices with replacement from a multinomial distribution where each index has weight , thus obtaining new indices
propagate with a draw from to obtain a new collection of particles
The core components of PL are not new to the SMC arsenal. Early examples of related propagation methods include those of Kong et al., (1994), with resampling and the propagation of sufficient statistics by Liu and Chen, (1995, 1998), and look-ahead by Pitt and Shephard, (1999). Like many SMC algorithms, PL is susceptible to an accumulation of Monte Carlo error with large data sets. However, two aspects of our setup mitigate these concerns to a large extent. Firstly, the over-arching goal of sequential design is to keep data sets as small as possible. GPs scale poorly to large data sets anyways, regardless of the method of inference (SMC, MCMC, etc.), so drastically different approaches are recommended for large-scale sequential design. Secondly, we only use vague priors for parameters which can be analytically integrated out in the posterior predictive—the main workhorse of PL—so that there is no need to sample them. In this way we extend the class of models for which SMC algorithms apply. However, we note that in order to use vague priors we must initialize the particles at some time . Further explanation and development is provided in Section 2.
Particle Learning for Gaussian processes
To implement PL for GPs we need to: identify the sufficient information ; initialize the particles; derive for the resample step; and determine for the propagate step. We first develop these quantities for GP regression and then extend them to classification. Although GPs are not dynamic models, we will continue to index the data size, which was in in Section 1.1, with in the SMC framework so that . We use for the number of particles. As GPs are nonparametric priors, their sufficient information has size in , i.e., they depend upon the full . For example, the covariance typically requires maintaining quantities to store the distances between the pairs of rows in . Therefore is tacitly part of the sufficient information .
Propagate: The propagate step updates each resampled sufficient information to account for . Since the parameters to are static, i.e., they do not change in , they may by propagated deterministically by copying them from to . We note that, as a matter of efficient bookkeeping, it is the correlation matrix and its inverse that are required for our PL update, not the values of the parameters directly. The new is built from and , for as
Deterministically copying in the propagate step is fast, but it may lead to particle depletion in future resample steps. An alternative is to augment the propagate with a sample from the posterior distribution via MCMC to rejuvenate the particles (e.g., MacEachern et al.,, 1999; Gilks and Berzuini,, 2001). In our regression GP context, just a single MH step for the parameters to using Eq. (1), for each particle, suffices. The particles represent “chains” in equilibrium so it is sensible to tune the MH proposals for likely acceptance by making their variance small, initially, relative to the posterior at the starting time , and then further decreasing it multiplicatively as increments. Such MH rejuvenations position the propagate step as a local maneuver in the Monte Carlo method, whereas resampling via the predictive is a more global step. Together they can emulate an ensemble method.
Consider the 1-d synthetic sinusoidal data first used by Higdon, (2002),
where , capturing two periods of low fidelity oscillation (the sine term). We observe the response with noise . At this noise level it is difficult to distinguish the high fidelity oscillations (the cosine term) from the noise without many samples. We used a Latin hypercube design (LHD, e.g., Santner et al.,, 2003, Section 5.2.2)—just large enough to begin to detect the high fidelity structure.
The left panel of Figure 1 shows the point-wise predictive distribution for each of the 1,000 particles in terms of the mean(s) and central 90% credible interval(s) of the Student- distributions (3–4) with parameters , and obtained from . Their average, the posterior mean predictive surface, is shown on the right. Observe that some particles lead to higher fidelity surfaces (finding the cosine) than others (only finding the sine). Figure 2 shows the samples of the range () and nugget () obtained from the particles. Only 200 of the 1,000 are shown to reduce clutter. The clustering pattern of the black diamonds indicates a multimodal posterior.
For contrast we also took 10,000 MCMC samples from the full data posterior, thinning every 10 and saving 1,000. This took about one minute on our workstation, which is faster than the full PL run, but much slower than the individual updates . The marginal chains for and seemed to mix well (not shown) but, as Figure 2 shows [plotting last 200 sample pairs as red squares], the chain nevertheless became stuck in a mode of the posterior, and only explored a portion of the high density region.
For a more numerical comparison we calculated the RMSE of predictive means (obtained via PL and MCMC, as above) to the truth on a random LHD of size 1000. This was repeated 100 times, each with new LHD training (size 50, as above) and test sets. The mean (sd) RMSE was for PL, and for MCMC. As paired data, the average number of times PL had a lower RMSE than MCMC was 0.64, which is statistically significant () using a standard one-sided -test. In short, this means that the SMC/PL method is performing at least as well as the MCMC with quicker sequential updates. The MCMC could be re-tuned, restarted, and/or run for longer to narrow the RMSE gap, but all of these would come at greater computational expense.
2 Classification
Resample: It may be helpful to think of the latent as playing the role of (hidden) states in a dynamic model. Indeed, their treatment in the PL update is similar. However, note that they do not satisfy any Markov property. The predictive density , which is needed for the resample step, is the probability of the label under the sufficient information : . This depends upon the latents , which are not part of . For an arbitrary , the law of total probability gives
The second equality comes since, conditional on , the label does not depend on any other quantity (5). The GP priors are independent, so decomposes as
where each component in the product is a Student- density (3–4).
The -dimensional integral in Eq. (7) is not analytically tractable, but it is trivial to approximate by Monte Carlo as follows. Simulate many independent collections of samples from each of the Student- distributions (8):
Sampling the latents may proceed via ARS, following Neal, (1998). However, as in the regression setup, we prefer a more local move in the PL propagate context to compliment the globally-scoped resample step. So instead we follow Broderick and Gramacy, (2010) in using 10-fold randomly blocked MH-within-Gibbs sampling. This approach exploits a factorization of the posterior as the product of the class likelihood (5) given the underlying latents and their GP prior (7): (dropping the )
Here, is an element of a 10-fold (random) partition of the indices , where and is its compliment. Extending the predictive equations from Section 2.1, the latter term in Eq. (11) is an -dimensional Student- with ,
using the condensed notation , and matrix , etc. A thus proposed may be accepted according to the likelihood ratio since the prior and proposal densities cancel in the MH acceptance ratio. Let denote the collection of latents comprised of , , and . Then the MH acceptance probability is where
Upon acceptance we replace with , and otherwise do nothing. In this way we loop over and to obtain a set of fully propagated latents.
An Illustration: Consider data generated by converting a real-valued output into classification labels (Broderick and Gramacy,, 2010) by taking the sign of the sum of the eigenvalues of the Hessian of . This gives a two-class process where the class is determined by the direction of concavity at . For our illustration we take , and create a third class from the first class (negative sign) where . We use GPs, and take our data set to be input–class pairs from a maximum entropy design (MED, Santner et al.,, 2003, Section 6.2.1). Our particles are initialized using 10,000 MCMC rounds at time , thinning every 10. This takes less than 2 minutes in R on our workstation. Then we proceed with 108 PL updates, which takes about four hours. The first few updates take less than a minute, whereas the last few take 7–8 minutes.
For a further comparison of timings on a larger classification problem we duplicated the 10-fold cross validation (CV) experiment of Broderick and Gramacy, (2010) on the two-class credit approval data which has covariates for 690 pairs. The time required for the final PL update () with particles, averaged over the 10 CV folds, was 38 minutes. The resulting predictor(s) gave exactly the same misclassification error(s) averaging ( sd) on the hold out sets as a similar estimator based on MCMC. However, the authors reported that the MCMC took about hours on average. So even with a modestly large design (), the Monte Carlo error that might accumulate with the use of vague priors in SMC does not seem to (yet) be an issue in our PL implementation. The savings in time is huge due the decomposition of far fewer covariance matrices in the SMC framework.
Sequential design
Here, we illustrate how the online nature of PL is ideally suited to sequential design by AL. Probably the most straightforward AL algorithms in the regression context are ALM and ALC [see Section 1.1]. But these are well known to approximate space filling MEDs for stationary GP models. So instead we consider the sequential design problem of optimizing a noisy black box function. In the classification context we consider the sequential exploration of classification boundaries.
The situation is more complicated when optimizing a noisy function, or with Bayesian inference via Monte Carlo. A re-definition of accounts for the noisy () responses: either as the first order statistic of or as the minimum of the predictive mean surface, . Now, each sample (e.g., each particle) from the posterior emits an EI. Using our Student- predictive equations (3–4) for , letting , we have (following Williams et al.,, 2000):
A remedy, proposed to ensure convergence in the optimization, involves pairing EI with a deterministic numerical optimizer. Taddy et al., (2009) proposed using a GP/EI based approach (with MCMC) as an oracle in a pattern search optimizer called APPS. This high powered combination offers convergence guarantees, but unfortunately requires a highly customized implementation that precludes its use in our illustrations. Gramacy and Taddy, (2009, Section 3) propose a simpler, more widely applicable, variant via the opposite embedding. There are (as yet) no convergence guarantees for this heuristic, but it has been shown to perform well in many examples.
2 Online learning of classification boundaries
In Section 2.2 [Figure 3] we saw how the predictive entropy could be useful as an AL heuristic for boundary exploration. Joshi et al., (2009) observed that when , the probability of the irrelevant class(es) near the boundary between two classes can influence the entropy, and thus the sequential design based upon it, in undesirable ways. They showed that restricting the entropy calculation to the two highest probabilities (best–versus–second–best [BVSB] entropy) is a better heuristic.
Figure 5 shows the sequential design obtained via PL with particles and the BVSP entropy AL heuristic using a pre-defined set of 300 MED candidate locations. The design was initialized with a sub-MED (from the 300), and AL was performed at each of rounds on the remaining candidates. This time there are 40 misclassified points, compared to the 76 obtained with a static design [Section 2.2; the same 1,000 MED test set was used]. The running time here is comparable to the static implementation. MCMC gives similar results but takes 4–5 times longer.
Working off-grid, e.g., with a fresh set of LHD candidates in each AL round, is slightly more challenging because the predictive entropy is very greedy. Paradoxically, the highest (BVSB) entropy regions tend to be near the boundaries which have been most thoroughly explored—straddling it with a high concentration of points—even though the entropy rapidly decreases nearby. One possible remedy involves smoothing the entropy by a distance-based kernel (e.g., from the GP) over the candidate locations. Applying this heuristic leads to very similar results as those reported in Figure 5, and so they are not shown here.
Discussion
We have shown how GP models, for regression and for classification, may be fit via the sequential Monte Carlo (SMC) method of particle learning (PL). We developed the relevant expressions, and provided illustrations on data from both contexts. Although SMC methods are typically applied to time series data, we argued that they are also well suited to scenarios where the data arrive online even when there is no time or dynamic component in the model. Examples include sequential design and optimization, where a significant aspect of the problem is to choose the next input and subsequently update the model fit. In these contexts, MCMC inference has reigned supreme. But MCMC is clearly ill-suited to online data acquisition, as it must be restarted when the new data arrive. We showed that the PL update of a particle approximation is thrifty by contrast, and that adding rejuvenation to the propagate steps mimicks the behavior of an ensemble without explicitly maintaining one.
Another advantage of SMC methods is that they are “embarrassingly parallelizable”, since many of the relevant calculations on the particles may proceed independently of one another, up to having a unique computing node for each particle. In contrast, the Markov property of MCMC requires that the inferential steps, to a large extent, proceed in serial. Getting the most mileage out of our SMC/PL approach will require a careful asynchronous implementation. Observe that the posterior predictive distribution, and the propagate step, may be calculated for each particle in parallel. Resampling requires that the particles be synchronized, but this is fast once the particle predictive densities have been evaluated. Our implementation in the plgp package does not exploit this parallelism. However, it does make heavy use of R’s lapply method, which automatically loops over the particles to calculate the predictive, and to propagate. A parallelized lapply, e.g., using snowfall and sfCluster, as described by Knaus et al., (2009), may be a promising way forward.