Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
COMPUTATIONAL IMPLEMENTATION OF GAUSSIAN PROCESS MODELS
Document Type and Number:
WIPO Patent Application WO/2021/043670
Kind Code:
A1
Abstract:
A computer-implemented method of processing training data comprising a plurality of training data items to determine parameters of a Gaussian process (GP) model comprising a variational Gaussian process (VGP) corresponding to a GP prior conditioned and marginalised with respect to a set of randomly- distributed inducing variables includes initialising first parameters of the VGP including a positive-definite matrix-valued slack parameter, and iteratively modifying the first parameters to increase or decrease an objective function comprising an expected log-likelihood for each training data item under a respective Gaussian distribution with a predictive variance depending on the slack parameter. At each iteration, modifying the first parameters comprises, for each training data item, determining a respective gradient estimator for the expected log-likelihood using a respective one of a plurality of processor cores, and modifying the first parameters in dependence on the determined gradient estimators. At an optimal value of the slack parameter, the slack parameter is equal to an inverse of a covariance matrix for the set of inducing variables, and the objective function corresponds to a variational lower bound of a marginal log-likelihood for a posterior distribution corresponding to the GP prior conditioned on the training data.

Inventors:
VAN DER WILK MARK (GB)
JOHN SEBASTIAN (GB)
ARTEMEV ARTEM (GB)
HENSMAN JAMES (GB)
Application Number:
PCT/EP2020/074023
Publication Date:
March 11, 2021
Filing Date:
August 27, 2020
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
SECONDMIND LTD (GB)
International Classes:
G06N7/00
Foreign References:
EP3467718A12019-04-10
US20140358831A12014-12-04
EP3467717A12019-04-10
EP3467718A12019-04-10
Other References:
HUGH SALIMBENI ET AL: "Doubly Stochastic Variational Inference for Deep Gaussian Processes", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 24 May 2017 (2017-05-24), pages 1 - 16, XP081403789
Attorney, Agent or Firm:
EIP (GB)
Download PDF:
Claims:
CLAIMS

1. A computer-implemented method of processing, using a plurality of processor cores, training data comprising a plurality of training data items to determine parameters of a Gaussian process (GP) model comprising a variational Gaussian process (VGP) corresponding to a GP prior conditioned and marginalised with respect to a set of randomly-distributed inducing variables, the method comprising: initialising first parameters of the GP model, the first parameters including a positive-definite matrix-valued slack parameter; and iteratively modifying the first parameters to increase or decrease an objective function comprising an expected log-likelihood for each training data item under a respective Gaussian distribution with a predictive variance depending on the slack parameter, wherein at each iteration modifying the first parameters comprises: for each training data item, determining a respective gradient estimator for the expected log-likelihood using a respective one of the plurality of processor cores; and modifying the first parameters in dependence on the determined gradient estimators, wherein at an optimal value of the slack parameter: the slack parameter is equal to an inverse of a covariance matrix for the set of inducing variables; and the objective function corresponds to a variational lower bound of a marginal log-likelihood for a posterior distribution corresponding to the GP prior conditioned on the training data.

2. The method of claim 1, wherein the predictive variance of the respective latent Gaussian distribution for the nth training data item is equal to wherein: knn corresponds to a kernel of the GP prior evaluated at the training data item; kun corresponds to the kernel of the GP prior evaluated between the set of inducing variables and the training data item;

Kuu is the covariance matrix for the set of inducing variables and corresponds to the kernel of the GP prior evaluated at the set of inducing variables; Ŝ is a variational parameter depending on the covariance S of the VGP evaluated at the inducing inputs;

T is the slack parameter; and at said optimal value of the slack parameter: the slack parameter T is equal to ; and the covariance S of the VGP evaluated at the inducing inputs is equal to KuuŜKuu.

3. The method of claim 2, wherein the covariance S of the VGP evaluated at the inducing inputs is equal to S = Kuu + Kuu TKuu TKuu - 2Kuu TKuu + KuuŜKuu .

4. The method of claim 1, wherein the predictive variance of the respective latent Gaussian distribution for the nth training data item is equal to , wherein: knn corresponds to a kernel of the GP prior evaluated at the training data item; kun corresponds to the kernel of the GP prior evaluated between the set of inducing variables and the training data item; Kuu is the covariance matrix for the set of inducing variables and corresponds to the kernel of the GP prior evaluated at the set of inducing variables; Ŝ is a variational parameter depending on the covariance S of the VGP evaluated at the inducing inputs;

T is the slack parameter; and at said optimal value of the slack parameter: the slack parameter T is equal to by and the covariance S of the VGP evaluated at the inducing inputs is equal to the variational parameter Ŝ.

5. The method of claim 4, wherein the covariance S of the VGP evaluated at the inducing inputs is equal to

S = Kuu + Kuu TKuu TKuu - 2Kuu TKuu + KuuTŜTKuu .

6. The method of any preceding claim, wherein: the objective function further comprises a Kullback-Leibler divergence between the VGP evaluated at the inducing inputs and the GP prior evaluated at the inducing inputs; and iteratively modifying the first parameters comprises determining an unbiased stochastic estimator for the gradient of said Kullback-Leibler divergence using random probe vectors.

7. The method of any preceding claim, wherein iteratively modifying the parameters comprises determining an unbiased stochastic estimator for the expected log-likelihood for a training data item using Monte Carlo sampling.

8. The method of any preceding claim, wherein iteratively modifying the parameters comprises performing stochastic gradient descent or ascent with a mini-batch of one or more of the training data points at each gradient step. 9. The method of any preceding claim, wherein the VGP is a layer in a variational deep GP. 10. The method of any preceding claim, comprising storing the modified first parameters upon a determination that predetermined convergence criteria have been satisfied.

11. The method of any preceding claim, wherein at each iteration, determining the respective gradient estimator for each training data item comprises determining the predictive variance of the respective Gaussian distribution using reduced-precision arithmetic.

12. A data processing system arranged to process training data comprising a plurality of training data items to determine parameters of a Gaussian process

(GP) model comprising a variational Gaussian process (VGP) corresponding to a GP prior conditioned and marginalised with respect to a set of randomly- distributed inducing variables, the data processing system comprising a plurality of processor cores, wherein the data processing system is arranged to: initialise first parameters of the VGP including a positive definite matrix-valued slack parameter; and iteratively modify the first parameters to increase or decrease an objective function comprising an expected log-likelihood for each training data item under a respective Gaussian distribution with a predictive variance depending on the slack parameter, wherein at each iteration modifying the first parameters comprises: for each training data item, determining a respective gradient estimator for the expected log-likelihood using a respective one of the plurality of processor cores; and modifying the first parameters in dependence on the determined gradient estimators, wherein at an optimal value of the slack parameter: the slack parameter is equal to an inverse of a covariance matrix for the set of inducing variables; and the objective function corresponds to a variational lower bound of a marginal log-likelihood for a posterior distribution corresponding to the GP prior conditioned on the training data.

13. The data processing system of claim 12, wherein: each of the plurality of processor cores is arranged to perform arithmetic operations using reduced-precision arithmetic; and at each iteration, determining the respective gradient estimator for each training data item comprises determining the predictive variance of the respective Gaussian distribution using reduced-precision arithmetic.

14. The data processing system of claim 12 or 13, comprising a neural network accelerator (NNA), wherein the multiple processor cores are components of the NNA.

15. A computer program product comprising instructions which, when executed by processing circuitry of a computer, cause the computer to perform the method of any of claims 1 to 11.

16. A processing unit for use in a computing system and arranged to process data comprising a plurality of training data items to determine parameters of a Gaussian process (GP) model comprising a variational Gaussian process (VGP) corresponding to a GP prior conditioned and marginalised with respect to a set of randomly-distributed inducing variables, the processing unit comprising: a data interface configured to receive the plurality of training data items; and processing circuitry comprising a plurality of processing nodes, wherein the processing circuitry is arranged to: initialise first parameters of the GP model, the first parameters including a positive-definite matrix-valued slack parameter; and iteratively modify the first parameters to increase or decrease an objective function comprising an expected log-likelihood for each training data item under a respective Gaussian distribution with a predictive variance depending on the slack parameter, wherein at each iteration modifying the first parameters comprises: for each training data item, determining a respective gradient estimator for the expected log-likelihood using a respective one of the plurality of processing nodes; and modifying the first parameters in dependence on the determined gradient estimators, wherein at an optimal value of the slack parameter: the slack parameter is equal to an inverse of a covariance matrix for the set of inducing variables; and the objective function corresponds to a variational lower bound of a marginal log-likelihood for a posterior distribution corresponding to the GP prior conditioned on the training data.

17. The processing unit of claim 16, wherein: each of the plurality of processing nodes is arranged to perform arithmetic operations using reduced-precision arithmetic; and at each iteration, determining the respective gradient estimator for each training data item comprises determining the predictive variance of the respective Gaussian distribution using reduced-precision arithmetic.

18. The processing unit of claim 16 or 17, being any one of an application- specific standard product, ASSP, an application-specific integrated circuit, ASIC, or a field-programmable gate array, FPGA.

Description:
COMPUTATIONAL IMPLEMENTATION OF GAUSSIAN PROCESS

MODELS

Technical Field The present invention relates to the computational implementation of

Gaussian process models.

Background

Gaussian process (GP) models provide a powerful and flexible means of inferring statistical quantities from empirical data. In recent years, GP models have been used in various contexts in machine learning, for example in classification tasks such as image classification and in regression tasks such as in engineering and other applications. GPs have further been proposed as a tool for predicting states of an environment in a reinforcement learning system as described in European patent publications EP3467717 and EP3467718. For an appropriate choice of kernel function, GPs have a high expressive capacity which can be further increased by composing multiple GP layers to form a deep Gaussian Process (DGP) model. GP models and DGP models automatically yield well-calibrated uncertainties, which are of particular importance when high-impact decisions are to be made on the basis of the model.

A Gaussian process (GP) is a collection of infinitely many indexed random variables of which every finite collection has a multivariate Gaussian distribution. The distribution of a Gaussian process is the joint distribution of the infinitely many random variables, and as such can be considered as a distribution over functions on a continuous domain. In a typical GP inference task, the objective is to fit a latent GP to a set of observed training data D = such that the trained GP can be used to predict a distribution of an output value y * at an unobserved input location x * . This description encapsulates regression, in which an output y corresponds to one or more attributes of a corresponding input location x, and classification, in which an output y corresponds to a probability of the input location x being associated with a given class. A single-layer GP model can be expressed as: where and it has been assumed that the likelihood factorizes over the training data in the dataset D, which corresponds to the assumption that the training outputs y n can be modelled as independent random variables. The GP prior p(ƒ(·)) is defined using a mean function m(·) and a kernel k(·,·'), where · and ·' denote unspecified input locations. The training process seeks to determine or approximate the posterior process corresponding to the GP prior conditioned on the training data. In the model of Equation (1), the function ƒ(·) and the outputs y n are written as scalars, but the methods described herein are equally valid for multi-output GPs in which the function ƒ(·) and optionally the outputs y n are vectors.

Variational inference proceeds with the introduction of a set of inducing variables u = ƒ(Z), where is a set of M inducing inputs which may be in the same domain as the input data x n or may be in a different domain. Using inducing inputs significantly reduces the computational cost of the training process provided that the number of inducing points is much smaller than the number of training data, i.e. M « N. The inducing variables are distributed according to a variational Gaussian distribution where the mean m and covariance Ŝ are to be determined during training. Marginalising the posterior process over the inducing variables u leads to a variational GP (VGP) given by Equation (2): where k.„ k u . and K uu are the covariances between an unspecified point · and the inducing variables u. For readability, the mean function m(·) has been set to zero, though the VGP method is straightforwardly extended to include a non- zero mean function. A conventional way to train a VGP of the type given by Equation (2) is to iteratively modify the variational parameters m, S,Z along with any hyperparameters of the kernel k in order to minimise the Kullback-Leibler (KL) divergence between the VGP q(ƒ(·)) evaluated at the training data points and the Bayesian posterior evaluated at the training data points. The KL divergence is given by Equation (3): where with ƒ n = ƒ(x n ) and The KL divergence in Equation (3) is non-negative, with equality when the VGP q(ƒ(·)) matches the Bayesian posterior process The quantity £ is therefore a variational lower bound of the marginal log-likelihood logp(y). Maximising the variational bound £ with respect to the variational parameters m, S,Z minimises the KL divergence between the VGP and the Bayesian posterior process. Maximising the variational bound with respect to the hyperparameters of the kernel maximises the marginal likelihood logp(y) of the training data, or in other words how well the exact model fits the training data. By treating the variational bound as an objective function to be maximised with respect to the variational parameters and the hyperparameters simultaneously, over a series of training iterations the VGP tends towards a Bayesian posterior process for an optimal GP prior.

Equation (4) shows that the objective function £ includes an expected log-likelihood for each training data point under a Gaussian distribution with a predictive variance corresponding to the variance of the VGP evaluated at that training data item. In this way, the objective function allocates a reward when the VGP yields a high probability density for the training data. The objective function further contains a KL term that penalises a deviation between the variational distribution q (u) for the inducing variables and the GP prior evaluated at the inducing inputs.

Figures 1 and 2 show an illustrative example of a VGP being trained to fit training data in a one-dimensional regression problem. Five training data points are shown as " X " symbols and the solid curves represent a single standard deviation above and below the posterior mean function of the VGP. The inner frame shows the normal distribution corresponding to the VGP evaluated at the point x 4 . Figure 1 corresponds to an early training iteration, and it is observed that the VGP does not fit the data well. Figure 2 corresponds to a later training iteration, and it is observed that the VGP more closely fits the data, whilst still providing a measurement of uncertainty via the variance of the VGP at each input location.

Existing methods maximise the objective function £ (or equivalently, minimise —£) with respect to the variational parameters and hyperparameters using gradient ascent/descent, stochastic gradient ascent/descent, or a variant thereof. In many cases, the expectation terms are intractable and must be estimated numerically, for example using Monte-Carlo sampling. However, even using Monte-Carlo sampling, it is necessary to determine the predictive mean m h and the predictive variance at each training data location in order to estimate the expected log-likelihood of the training data. The computational cost of inverting the covariance matrix K uu is 0(M 3 ), whilst the computational cost of the matrix multiplications for each training data point is 0(M 2 ), resulting in a total computational cost of 0(NM 2 + M 3 ) for evaluating or estimating the expectation terms at each training iteration. Stochastic gradient descent with mini-batches of size B can be used to reduce the computational cost to 0(BM 2 + M 3 ) such that the 0(BM 2 ) term becomes negligible. However, the 0(M 3 ) cost of inverting the covariance matrix remains prohibitive for large numbers of inducing points, which are necessary to learn the complex structures that exist within large datasets. This computational cost prevents conventional GP variational inference from scaling to large datasets and accordingly from competing with deep neural network models in computer-implemented systems across a wide range of technical fields. Furthermore, the matrix inversion relies on serial operations which are not readily parallelised across multiple processor cores, and requires high precision arithmetic (for example, double precision arithmetic) to yield accurate results. The matrix inversion thus causes a bottleneck in the data processing routine whilst preventing the routine from being implemented efficiently with specialist deep learning hardware such as neural processing units (NPUs) or neural network accelerators (NNAs), which are optimised for highly parallelised computations with low precision arithmetic.

Summary

According to a first aspect of the present invention, there is provided a computer-implemented method of processing, using a plurality of processing cores, training data comprising a plurality of training data items to determine parameters of a Gaussian process (GP) model comprising a variational Gaussian process (VGP) corresponding to a GP prior conditioned and marginalised with respect to a set of randomly-distributed inducing variables. The method includes initialising first parameters of the VGP including a positive-definite matrix-valued slack parameter, and iteratively modifying the first parameters to increase or decrease an objective function comprising an expected log-likelihood for each training data item under a respective Gaussian distribution with a predictive variance depending on the slack parameter. At each iteration, modifying the first parameters comprises, for each training data item, determining a respective gradient estimator for the expected log- likelihood using a respective one of the plurality of processor cores, and modifying the first parameters in dependence on the determined gradient estimators. At an optimal value of the slack parameter, the slack parameter is equal to an inverse of a covariance matrix for the set of inducing variables, and the objective function corresponds to a variational lower bound of a marginal log-likelihood for a posterior distribution corresponding to the GP prior conditioned on the training data. Introducing the matrix-valued slack parameter to be optimised alongside other parameters of the VGP removes the need to invert a covariance matrix at each training iteration, and the computational cost of determining the optimal inverse covariance matrix is effectively amortised over multiple training iterations. In this way, the computational bottleneck caused by the matrix inversion is removed from the training procedure, and the data processing at each training iteration can be performed in a highly parallelised manner, for example using multiple cores in a specialised processor such as a graphics processing unit (GPU) or a neural network accelerator (NNA), or over multiple computer nodes in a distributed computer system.

Further features and advantages of the invention will become apparent from the following description of preferred embodiments of the invention, given by way of example only, which is made with reference to the accompanying drawings.

Brief Description of the Drawings

Figures 1 and 2 show an example of a variational Gaussian process (VGP) being optimised to fit a set of observed training data.

Figure 3 is a flow diagram representing a method of training a VGP in accordance with an embodiment of the present invention.

Figure 4 shows a data processing system arranged in accordance with an embodiment of the present invention.

Figure 5 shows schematically a variational deep Gaussian process (DGP) model being trained to fit a set of observed training data.

Figure 6 shows a reinforcement learning subsystem incorporating an embodiment of the present invention.

Figure 7 shows a computing system comprising a processing unit arranged in accordance with an embodiment of the present invention.

Detailed Description

Figure 3 shows an example of a data processing system 300 arranged to perform statistical inference in accordance with an embodiment of the present invention. The system includes various additional components not shown in Figure 3 such as input/output devices, network interfaces, and the like. The data processing system 300 includes first memory circuitry including main storage 302, which in this example is a solid-state drive (SSD) for non- volatile storage of relatively large volumes of data. In other examples, a data processing system may additionally or instead include a hard disk drive and/or removable storage devices as first memory circuitry. The data processing system 300 further includes second memory circuitry including working memory 304, which in this example includes volatile random-access memory (RAM), in particular static random-access memory (SRAM) and dynamic random-access memory (DRAM).

The working memory 304 is more quickly accessible by processing circuitry than the main storage 302 but has a significantly lower storage capacity. In this example, the main storage 302 is capable of storing an entire dataset D containing N training data points. By contrast, in this example the working memory 304 has insufficient capacity to store the entire dataset D but has sufficient capacity to store a mini-batch B formed of a subset of the training data points. The working memory 304 is further arranged to store parameters for a variational inference model including variational parameters , Ŝ and Z of a VGP q(ƒ(·)), a positive-definite matrix-valued slack parameter T, and hyperparameters of the kernel k of the VGP.

The data processing system 300 includes a sampler 312, which in the present example is implemented as program code executed by processing circuitry of the data processing system 300, though in other examples may be a hardware component such as an application specific integrated circuit (ASIC). The sampler 312 is arranged to randomly sample mini-batches of training data points from the dataset D and to transfer the randomly sampled mini-batches from the main storage 302 to the working memory 304.

The data processing system 300 includes an inference module 308, which includes processing circuitry configured to perform variational inference in accordance with the present invention. In this example, the inference module 308 includes multiple processor cores 310, of which four processor cores 310a- d are shown. In this example, the processor cores are located within an NNA, though in other examples multiple processor cores may be included for example in one or more processing units such as a graphics processing unit (GPU) or a central processing unit (CPU). In the present example, performing variational inference involves determining parameters which maximise an objective function £ mod which is a modified version of objective function £ of Equation (4). The resulting parameters correspond to a best fit of the VGP to the dataset D. As will be explained in more detail hereafter, the modification of the objective function allows for variational inference to be performed efficiently and in a parallelised manner over multiple processing cores and/or using a distributed data processing system by removing the need to explicitly invert a covariance matrix at each training iteration.

Example implementation for log-concave likelihoods A log-concave likelihood is one for which fory n Î for all values n = 1 , ...,N. An example of a log-concave likelihood is a Gaussian likelihood, which is commonly used in regression problems and is defined as In a first embodiment of the present invention, which is valid for any model with a log-concave likelihood, the objective function of Equation (4) is modified as shown in Equation (5): with and where and Ŝ are variational parameters related the mean m and covariance S of the variational distribution q (u) respectively. In the present embodiment, the mean m of the variational distribution is related to the variational parameter in via the relation and the covariance Ŝ of the variational distribution is related to the variational parameter Ŝ via the relation S = K uu ŜK uu. By reparameterising the mean and covariance in this way, the expectation terms in the modified objective function can be computed without inverting the covariance matrix K uu. The predictive mean μ n is unchanged by the reparameterisation, whilst the modified predictive variance is greater than or equal to the unmodified predictive variance , with equality when the slack parameter T is equal to the inverse of the covariance matrix K uu. The modified objective function £ mod is therefore a lower bound of the unmodified objective function £, with equality when the slack parameter T is equal to the inverse of the matrix K uu. It can be shown that introducing the slack parameter T does not introduce any additional local optima to the objective function, and therefore simultaneously optimising the variational parameters m and Ŝ and the hyperparameters of the kernel with the slack parameter T results in the modified objective function £ mod tending towards the optimised value of the unmodified objective function £, with the VGP tending towards a solution that is equal to the solution determined using the unmodified objective function. It is stressed that although the solution determined using the present invention is the equally as good as that determined using existing approximations, the computational cost of inverting a covariance matrix at each training iteration is avoided.

As discussed above, the unmodified objective function £ contains terms corresponding to an expected log-likelihood for each data point under the predictive variance of the VGP. The modified objective function similarly contains terms corresponding to an expected log-likelihood for each data point, but this time under a Gaussian distribution with a predictive variance which is greater than the predictive variance of the VGP evaluated at the training data item, except for at the optimal value of the slack parameter T, at which point the modified predictive variance is equal to the unmodified predictive variance The dashed curves in Figures 1 and 2 represent a single modified standard deviation above and below the mean function of the VGP, whilst the inner frames show modified normal distributions corresponding to the VGP evaluated at the point x 4 with the overestimated variance It is observed that in Figure 1, corresponding to an early training iteration, the modified predictive variance is significantly greater than the unmodified predictive variance. In Figure 2, corresponding to a later training iteration, the modified predictive variance is only slightly greater than the unmodified predictive variance. Eventually, the modified predictive variance converges to the unmodified predictive variance as the slack parameter converges to the inverse of the covariance matrix.

In the present implementation, the slack parameter T and the variational parameter Ŝ are each decomposed using Cholesky decomposition such that where L T and L Ŝ are real lower-triangular matrices. The number of scalar parameters in each of the matrices T and Ŝ is therefore reduced from M 2 to M(M + 1)/2. Other decompositions are possible, for example a QR decomposition using Householder matrices. Using different decompositions may lead to varying performance of the optimisation procedure.

In addition to the decomposition of T, the parameterisation of the covariance S of the variational distribution q (u) in terms of the variational parameter Ŝ is not unique. Different parameterisations lead to different optimisation surfaces, which in some examples may improve the convergence properties of the objective function during training. In one embodiment, the covariance is parameterised using the slack parameter T as a preconditioner to give S = K uu TŜTK uu , leading to a different modified predictive variance given by In this embodiment the variational parameter Ŝ is equal to the covariance S at the optimal value of the slack parameter T. It is therefore expected that near the optimum, the dependence of the modified objective function on Ŝ will approximate the dependence of the unmodified objective function on S, resulting in similar convergence properties near this point. Numerical experiments have shown that in certain examples, optimisation is more efficient using this alternative parameterisation. It will be appreciated that other parameterisations are possible without departing from the scope of the invention. Example implementation for general likelihoods

The modified objective function £ mod described above is only guaranteed to be a lower bound of the unmodified objective function £ for GP models with log-concave likelihoods. Furthermore, the difference between the modified objective function and the marginal likelihood is not equal to the KL divergence between the VGP and the Bayesian posterior (analogous to Equation (3) for the unmodified objective function) and therefore the modified objective function cannot be considered a variational bound in the strict sense. In the present section, a further embodiment is presented which is valid for any likelihood and for which the objective function is a variational bound in the strict sense. For this embodiment, the modified predictive variance is the same as before, but the covariance S of the variational distribution q (u) is given by Equation (6):

S = K uu + K uu TK uu TK uu - 2K uu TK uu + K uu ŜK uu . (6)

Unlike the embodiments described above, in which the modified objective function £ mod is a lower bound of the unmodified objective function £, in the present embodiment, the modified objective function £ mo i is exactly equivalent to the unmodified objective function £ for a particular choice of parameters. In effect, the modification to the expected log-likelihood terms in £ mod is exactly cancelled out by a modified KL penalisation term, such that Equation (3) holds for £ mod and accordingly £ mod is a variational bound in the strict sense. Further embodiments can be realised by replacing Ŝ (consistently) in the expressions for the modified predictive variance and the covariance S. For example, if the alternative expression is used for the modified predictive variance, £ mod is a strict variational bound when the covariance S is given by Equation (7):

S = K uu + K uu TK uu TK uu - 2K uu TK uu + K uu Ŝ uu . Estimators for KL term

Each of the example methods described above removes the inverse covariance matrix from the expectation terms in £ mod , resulting in the computational cost of evaluating the expectation terms (and the gradients of the expectation terms) being reduced to 0(BM 2 ). The remaining term in £ mod is a KL divergence between two Gaussian distributions, and accordingly is known in closed form. However, the gradient of the KL term contains components with an 0(M 3 ) computational cost, and hence results in a further computational bottleneck in the training procedure. In order to perform gradient-based optimisation, it is necessary to determine the gradient of the KL term with respect to the parameters of the VGP model, or otherwise to determine an unbiased stochastic estimator for the gradient of the KL term. In some embodiments, an unbiased stochastic estimator for the gradient of the KL term is determined using random probe vectors. Using random probe vectors removes the 0(M 3 ) computational cost by replacing matrix-matrix multiplications with a series of matrix-vector multiplications, as will be described in more detail hereafter.

The KL term in Equation (5) has a closed-form expression given by Equation (8):

By substituting the reparameterised expressions for S and m, the inverses of the covariance matrix are removed from Equation (8). However, the gradients of the trace and log-determinant terms still have a computational cost of 0(M 3 ). More specifically, the trace includes terms of the form Tr(K uu Mj ...Mj) where each Mj for j = 1 ...J is an M X M square matrix. Each matrix-matrix product in these trace terms contributes an 0(M 3 ) computational cost. However, unbiased stochastic estimators for these terms can be determined using Hutchinson’s trace estimator, as shown by Equation (9): where each of the one or more random probe vectors r i ~ p(r) is sampled from a distribution with zero mean and unit variance such that and Examples of such distributions are the normalised Gaussian distribution and the Rademacher distribution. By performing the multiplications in Equation (9) from left to right or from right to left, only matrix-vector multiplications are required (as opposed to matrix-matrix multiplications), resulting in an 0(HM 2 ) computational cost. The gradient of this stochastic estimator is determined using reverse-mode differentiation, which also has an 0(HM 2 ) computational cost.

After substituting the reparameterised expression for S into Equation (8), a log-determinant term remains in the form logdet A for a square M X M matrix A. Reverse-mode differentiation of this term requires computation of the partial derivative ¶ [log det A]/ ¶A = A -1 . An unbiased estimator for this term is given by where each of the one or more random probe vectors p j is sampled from a distribution with zero mean and unit variance such that and An unbiased estimator Ŝ j of the quantity S j = A -1 p j is given by a randomly truncated conjugate gradient sum, as shown in Equation (9): where S ij is the i th term in the conjugate gradient expansion for S , the number of terms I j ~ p(i) is random and independent of the random probe vector p ,j and the weights w ij are chosen such that An unbiased estimator for A -1 is then given by Equation (11): which has a computational cost . Using the unbiased estimators of Equations (9) and (11) avoids the computation of any terms of 0(M 3 ) computational cost in the reverse-mode derivative of the KL term. It is noted that variants of the method described above may be used without departing from the scope of the invention, for example using preconditioning matrices to reduce the variance of the estimator in Equation (11). In an example where S = K uu ŜK uu , the matrix A is equal to the covariance matrix K uu and writing the quantity as results in faster convergence of the conjugate gradient sum, reducing the variance of the estimator of Equation (10) for a given number of terms, allowing a distribution p(i) with a lower expectation to be used.

It is noted that the method described above is not the only way of approximating the KL term in Equation (5). For example, alternative estimators for the terms in Equation (10) can be determined using a truncated Chebyshev polynomial approximation of the logarithm function. Further methods of approximating the KL term are envisaged and may be used without departing from the scope of the invention. Example method

Figure 4 shows an example of a method performed by the data processing system of Figure 3 to train a VPG in accordance with an embodiment of the present invention. The present method is compatible with any of the implementations described above. Prior to the method being carried out, the dataset D is stored in the main storage 302. The data processing system initialises, at S402, first parameters including variational parameters m, Ŝ and Z of the VGP, the positive-definite matrix-valued slack parameter T, and hyperparameters of the kernel k. In the present example, the first parameters are initialised randomly, though other strategies may be employed, for example using K-means clustering to initialise the inducing inputs Z. The sampler 306 randomly samples, at S404, a mini -batch B of training data points from the dataset 316, where , and transfers the sampled mini-batch from the main storage 302 to the working memory 404. The inference model 308 determines, at S406, an unbiased estimator for the gradient of the expected log-likelihood for each training data point in the mini- batch under a latent Gaussian distribution with mean μ n and variance In examples where the expectation term is intractable, an unbiased stochastic estimator is determined, for example using one or more Monte Carlo samples as shown in Equation (12) where and is the set of parameters to be optimised including the slack parameter T. In practice, samples of a random variable are drawn from a normalised Gaussian distribution N( 0, 1) and the sampled is determined as (this is sometimes referred to as the reparameterisation trick). Reverse mode differentiation is used to determine the gradient. For examples in which the expectation terms are tractable, Monte Carlo sampling is unnecessary. In the present example, computation or estimation of the gradient of the expectation terms is parallelised across the processor cores 310 and performed using single- precision arithmetic, both of which are made possible by the removal of the matrix inversion in the expressions for μ n and . In particular, the predictive variance is computed by performing vector-matrix products using single precision arithmetic, as opposed to double precision arithmetic which is typically used for computing inverses of large matrices. In other examples, other reduced-precision floating point number formats (having a lower precision that double precision) or fixed-point number formats may be used. The removal of the matrix inversion from the computation allows for lower precision number formats to be used, increasing the speed of the computation, without seriously compromising the accuracy of the result. We refer to arithmetic computations using reduced-precision floating point number formats or fixed-point number formats as reduced-precision arithmetic.

The inference module determines, at S408, an unbiased estimator for the gradient of the KL divergence term in Equation (5). In this example, random probe vectors are used as described above.

Having determined gradient estimators for the expectation terms and the KL term in £ mod , the inference module performs, at S410, a stochastic gradient descent update using the determined gradient estimators. The gradient descent/ascent update is given by where is an unbiased stochastic estimator for the gradient formed from the estimators determined at S406 and S408. The plus sign corresponds to stochastic gradient ascent, whereas the minus sign corresponds to stochastic gradient descent. The parameter n t is predetermined at each iteration t, and may be a scalar or otherwise may include a preconditioning matrix depending on which specific variant of stochastic gradient descent is used. Examples of variants of stochastic gradient descent are Adam and Limited-Memory Broyden-Fletcher- Goldfarb-Shanno (L-BFGS). The updated parameters are stored in working memory 304.

The method of Figure 4 is performed iteratively until either predetermined convergence criteria are satisfied or until a predetermined number of iterations have been performed. The resulting set of parameters may then be transferred to the main storage 302 or may remain in the working memory 304 to be used in further computations, for example to determine a predictive distribution over an unknown output y * for a given input x * .

Application to DGPs

The expressive capacity of a given single-layer GP model is limited by the choice of kernel function. Extending a GP model to having a deep structure can further improve the expressive capacity. In an example, a deep GP architecture is based on a composition of functions ƒ(·) = ƒ L (..., ƒ 2 1 (·))), where each component function f l is given a GP prior such that f l ~ GP(m l (.),k l (.,.')), where μ l is a mean function and k l is a kernel. The functions are hidden layers of the deep GP, whereas the function is the output layer of the deep GP (the outputs of the hidden layers and the output layer may be scalar- or vector- valued). The joint density for the deep GP model is given by Equation (13): in which h n,0 = x n and the (predetermined) form of determines how the output h n,l of a given GP layer depends on the output of the response function for that layer, and may be chosen to be stochastic or deterministic. In a specific deterministic example, the output of the layer is equal to the output of the response function, such that

In the present example, each layer of the deep GP is approximated by a variational GP q(ƒ l ) with marginals specified at a respective set Z l of inducing inputs , where the inducing inputs may be placed in the same domain as the input h n,l-1 for that layer, or may be placed in a different domain, resulting in so-called inter-domain inducing inputs. The outputs of the component function ƒ l at the inducing inputs are inducing variables u l l (Z l-1 ), which inherit multivariate Gaussian distributions q(u l ) = from the variational GP layers q(ƒ l ).

In the accordance with the present invention, a modified objective function for the variational DGP is given by Equation (14):

The objective function is estimated using mini-batches B of size . The modified posterior density appearing in Equation (14) is given by with the modified density for each layer given by Equations (15)-(17): where and with and S l =k l (Z l-1 , Z l-1 ) Ŝ l k l (Z l-1 , Z l-1 ). In the DGP example, T l is a positive-definite matrix-valued slack parameter for the l th layer and is to be optimised along with Ŝ l and Z l for l = 1 In other words, the same substitutions described above for the single-layer GP example are made within each layer of the DGP. Furthermore, all of the variants of the method described above apply for each layer within the DGP.

To overcome the intractability of the expectation terms in Equation (14), Monte Carlo samples are drawn from the distributions This is achieved using the reparameterisation trick mentioned above, where in this case a random variable is sampled from a normalised Gaussian distribution then the random variables n,l are evaluated using the sampled random variables and the iterative relation in which the square root and the product are taken element-wise. In this way, a stochastic estimator for the modified objective function is determined at each gradient ascent step, and reverse mode differentiation is used to determine a stochastic estimate for the gradient of the objective function. Due to the removal of the matrix inversion at each layer in the DGP, the evaluation of the modified objective function is performed at a relatively low computational cost and can be parallelised efficiently, allowing for scalable variational inference.

Figure 5 schematically shows a training phase performed by a data processing system with multiple processor cores (for example including an NNA) for a two-layer DGP model (L = 2) in a regression setting. Each training data point in a large dataset D is formed of an input data portion x n and an output data portion y n. At a given training iteration, a mini -batch B of training data points is sampled from the dataset and each of the training data points is allocated to a respective processor core (with some data points possibly being allocated to the same processor core). For each data point in the mini-batch, the allocated processor core performs a sequence of operations to determine a respective component of the gradient estimator More specifically, a first random variable is drawn from a normalised multivariate Gaussian distribution, and a vector h b,1 is determined using the relation which is determined without inversion of the covariance matrix k 1 (Z 0 ,Z 0 ) in accordance with the present invention. A second random variable is then drawn from the normalised multivariate Gaussian distribution, and a vector h b,2 is determined using the relation which is determined without inversion of the covariance matrix k 2 (Z 1 ,Z 1 ) in accordance with the present invention. The likelihood is then evaluated at the vector h b,2 , and the logarithm of this likelihood is used as a Monte Carlo estimate of the expectation value appearing in Equation (9). Reverse-mode differentiation is performed to determine the respective component of the gradient estimator An unbiased estimator for the gradient of each KL term in Equation (14) is determined using random probe vectors as described above, and a stochastic gradient ascent step is performed using the resulting gradient estimator This procedure is performed iteratively until predetermined convergence criteria have been satisfied or until a predetermined number of iterations have been performed. The GP and DGP models described above are applicable in a range of technical settings. In a regression setting, the dependent variable y n corresponds to a scalar or vector quantity representing an attribute of the data. Regression problems arise, for example, in engineering applications, weather forecasting, climate modelling, disease modelling, medical diagnosis, time- series modelling, and a broad range of other applications.

In addition to regression problems, the GP and DGP models described above are applicable to classification problems, in which case y n represents probabilities associated with various respective classes. Within a given training dataset, a class vector y n may therefore have a single entry of 1 corresponding to the known class of the data item x n , with every other entry being 0. In the example of image classification, the vector x n has entries representing pixel values of an image. Image classification has a broad range of applications. For example, optical character recognition (OCR) is based on image classification in which the classes correspond to symbols such as alphanumeric symbols and/or symbols from other alphabets such as the Greek or Russian alphabets, or logograms such as Chinese characters or Japanese kanji. Image classification is further used in facial recognition for applications such as biometric security and automatic tagging of photographs online, in image organisation, in keyword generation for online images, in object detection in autonomous vehicles or vehicles with advanced driver assistance systems (ADAS), in robotics applications, and in medical applications in which symptoms appearing in a medical image such as a magnetic resonance imaging (MRI) scan or an ultrasound image are classified to assist in diagnosis.

In addition to image classification, GPs and DGPs may be used in classification tasks for other types of data, such as audio data, time-series data, or any other suitable form of data. Depending on the type of data, specialised kernels may be used, for example kernels exhibiting a convolutional structure in the case of image data, or kernels exhibiting periodicity in the case of periodic time-series data. Application in reinforcement learning subsystem

Figure 6 shows a reinforcement learning system 600 which incorporates an embodiment of the present invention. The system 600 includes a client subsystem 602 and a learning subsystem 604, and data is transferred between the client subsystem 602 and the learning subsystem 604 via a first network module 610 and a second network module 612. In the present example, the learning subsystem 604 is a distributed cloud-based server system, and interacts with the client subsystem 602 using an Application Programming Interface (API). In the present example, the reinforcement learning system 600 is used to manage a fleet of taxis in a city. The client subsystem 602 is operated by the taxi fleet operator, whereas the learning subsystem 604 is operated by a service provider.

The client subsystem 602 includes a decision system 614 comprising N agents, collectively referred to as agents 616, of which three are shown for ease of illustration. The agents 616 are associated with entities 618 that interact with a physical environment 620. The agents 616 receive observation signals from the entities corresponding to observations of states of the environment 620, and generate action signals in dependence on the received observation signals in accordance with one or more policies. The agents 616 also receive rewards depending on the outcomes of the actions performed. Policies may be deterministic or stochastic, and can generally be viewed as parameterised mappings from state observations to actions. In the present example, a state observation offers only a partial description of the environment 618 (as is typically the case of physical environments), though in other examples a state observation may correspond to a complete description of a state of an environment (as is typically the case for a virtual environment such as in a video game). In the present example, the action signals generated by the agents 616 also depend on probabilistic model data generated by the model learner 608. The model data includes parameters of a GP model which provides probabilistic information about future states of the environment 618.

The learning subsystem 602 includes a policy learner 606 and a model learner 608. The policy learner 606 receives experience data corresponding to sequences of state observations, actions and rewards experienced by the agents 616. The policy learner 606 processes the experience data using reinforcement learning to generate policy data for the agents 616. The model learner 608 processes model input data using variational inference to determine parameters of a probabilistic GP model associated with the environment 620. Model input data may include, for example, historical data, state observation data received from the entities 618, and/or data indicative of measurements taken by sensors in the environment 620.

In the present example, the entities 618 are taxis and the environment 618 corresponds to a city. The observation signals include locations of taxi requests in the city, and the action signals include instructions for drivers of the taxis. The GP model in this example predicts rates of taxi requests as a function of time and location in the city, and is determined using a variational Cox process model as described in European patent publication EP3467718. A periodic or quasi-periodic kernel may be used to ensure the model captures periodic temporal variation, for example due to time of day, time of week, and/or time of year.

In the present example, the environment 620 is dynamic and accordingly may change over time. The GP model generated by the model learner 608 may therefore be occasionally or frequently updated to ensure that the agents 616 make decisions based on up to date information. It is desirable to use a large number of data points to train the model, and therefore conventional VGP methods will suffer due to the computational bottleneck described above. By contrast, the novel methods described above allow for efficient learning of the GP model parameters and furthermore allow for parallelisation of the model training process across the learning subsystem 604. In this way, the present invention facilitates the incorporation of GP -based probabilistic modelling into a reinforcement learning setting.

Processing unit

Figure 7 shows a computing system 700. The computing system 700 includes a CPU 702 and memory 704. The memory 704 in this example is volatile working memory including DRAM. The computing system 700 includes various additional components not shown in Figure 7, such as permanent storage, input/output devices, network interfaces, and the like. The computing system 700 also includes a specialist processing unit 706 configured to perform sparse variational inference in accordance with the present invention. In this example, the processing unit 706 is an integrated circuit which is integral to the computing system 700. In other examples, a processing unit may be removable from a computing system. The processing unit 706 in this example is an application-specific standard product (ASSP). Alternatively, the processing unit 706 could be replaced with another type of integrated circuit such as an application-specific integrated circuit (ASIC) or a field- programmable gate array (FPGA).

The processing unit 706 includes a data interface 708 via which the processing unit 706 can exchange data, including control data, with the CPU 702 and the memory 704. The processing unit 706 further includes a microcontroller 710 for controlling processing operations performed by the processing unit 706. A microcontroller is a compact integrated circuit designed to govern a specific set of operations in an embedded system. The microcontroller 710 in this example includes a processor and memory, including control registers and a small amount of RAM. The processing unit 706 further includes multiple processing nodes 714 (of which four, 714a-b, are shown), also referred to as compute engines or processor cores, each including a respective set of control registers 716, respective SRAM 718, and respective processing circuitry arranged to process data stored in the respective SRAM 718 in accordance with control data stored in the respective set of control registers 716. The microcontroller 710 is arranged to overwrite the control data stored by the processing nodes 714 during processing, such that the processing nodes 714 are configured to perform different processing operations at different stages of the training.

The processing unit 706 further includes a direct memory access (DMA) unit 712 arranged to exchange data transfer data between the memory 704 of the computing system 700 and the SRAM of the processing nodes 714, under instruction from the microcontroller 710. The data exchanged by the DMA 712 includes, for example, training data items from a training dataset trainable parameter values for a sparse variational GP, and intermediate values stored at training or test time.

During the training of a sparse variational GP in accordance with the present disclosure, each of the processing nodes 714 is configured to perform operations independently of the other processing nodes 714. In particular, the control unit is arranged to allocate each training data item to a respective one of the processing nodes 714, and the processing node is configured to determine a gradient estimator for an expected log-likelihood of the training data item under a Gaussian distribution with a predictive variance depending on a slack parameter T as discussed above. In this way, the determination of gradient estimators for updating the parameters of the VGP is parallelised across the processing nodes 714 without the need for the processing unit 706 to invert a covariance matrix.

The above embodiments are to be understood as illustrative examples of the invention. Further embodiments of the invention are envisaged. For example, although the method of Figure 4 is described as being performed by specific components of a data processing system, in other embodiments the functions of the various components may be implemented by different components, for example within processing circuitry and memory circuitry of a general-purpose computer. Alternatively, the functions may be implemented using a distributed computer system. Similarly, alternative arrangements are possible for a reinforcement learning subsystem, for example in which all of the functions of the system 600 are performed by a single computer. It will be appreciated that reinforcement learning subsystems of the type described above are not limited to fleet management systems, but may be used for a wide range of applications, such as in logistics or finance.

It is to be understood that any feature described in relation to any one embodiment may be used alone, or in combination with other features described, and may also be used in combination with one or more features of any other of the embodiments, or any combination of any other of the embodiments. Furthermore, equivalents and modifications not described above may also be employed without departing from the scope of the invention, which is defined in the accompanying claims.