def __init__(self, X, Y, Z, kernel, likelihood, mean_function=None, name='<STR_LIT>', Y_metadata=None, batchsize=None, num_latent_functions=None):
self.batchsize = batchsize<EOL>self.X_all, self.Y_all = X, Y<EOL>if batchsize is None:<EOL><INDENT>X_batch, Y_batch = X, Y<EOL><DEDENT>else:<EOL><INDENT>import climin.util<EOL>self.slicer = climin.util.draw_mini_slices(self.X_all.shape[<NUM_LIT:0>], self.batchsize)<EOL>X_batch, Y_batch = self.new_batch()<EOL><DEDENT>inf_method = svgp_inf()<EOL>super(SVGP, self).__init__(X_batch, Y_batch, Z, kernel, likelihood, mean_function=mean_function, inference_method=inf_method,<EOL>name=name, Y_metadata=Y_metadata, normalizer=False)<EOL>if num_latent_functions is None:<EOL><INDENT>num_latent_functions = Y.shape[<NUM_LIT:1>]<EOL><DEDENT>self.m = Param('<STR_LIT>', np.zeros((self.num_inducing, num_latent_functions)))<EOL>chol = choleskies.triang_to_flat(np.tile(np.eye(self.num_inducing)[None,:,:], (num_latent_functions, <NUM_LIT:1>,<NUM_LIT:1>)))<EOL>self.chol = Param('<STR_LIT>', chol)<EOL>self.link_parameter(self.chol)<EOL>self.link_parameter(self.m)<EOL>
Stochastic Variational GP.

For Gaussian Likelihoods, this implements

Gaussian Processes for Big data, Hensman, Fusi and Lawrence, UAI 2013,

But without natural gradients. We'll use the lower-triangluar
representation of the covariance matrix to ensure
positive-definiteness.

For Non Gaussian Likelihoods, this implements

Hensman, Matthews and Ghahramani, Scalable Variational GP Classification, ArXiv 1411.2005