GPy.inference.mcmc package¶
Submodules¶
GPy.inference.mcmc.hmc module¶
-
class
HMC
(model, M=None, stepsize=0.1)[source]¶ Bases:
object
An implementation of Hybrid Monte Carlo (HMC) for GPy models
Initialize an object for HMC sampling. Note that the status of the model (model parameters) will be changed during sampling.
Parameters: - model (GPy.core.Model) – the GPy model that will be sampled
- M (numpy.ndarray) – the mass matrix (an identity matrix by default)
- stepsize (float) – the step size for HMC sampling
-
sample
(num_samples=1000, hmc_iters=20)[source]¶ Sample the (unfixed) model parameters.
Parameters: - num_samples (int) – the number of samples to draw (1000 by default)
- hmc_iters (int) – the number of leap-frog iterations (20 by default)
Returns: the list of parameters samples with the size N x P (N - the number of samples, P - the number of parameters to sample)
Return type: numpy.ndarray