diff --git a/GPy/inference/mcmc/hmc.py b/GPy/inference/mcmc/hmc.py index 455e9411..54893769 100644 --- a/GPy/inference/mcmc/hmc.py +++ b/GPy/inference/mcmc/hmc.py @@ -1,22 +1,23 @@ -"""HMC implementation""" +# ## Copyright (c) 2012, GPy authors (see AUTHORS.txt). +# Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy as np class HMC: """ - An implementation of Hybrid Monte Carlo (HMC) for GPy models + 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. + + :param model: the GPy model that will be sampled + :type model: GPy.core.Model + :param M: the mass matrix (an identity matrix by default) + :type M: numpy.ndarray + :param stepsize: the step size for HMC sampling + :type stepsize: float """ def __init__(self, model, M=None,stepsize=1e-1): - """ - Initialize an object for HMC sampling. Note that the status of the model (model parameters) will be changed during sampling - :param model: the GPy model that will be sampled - :type model: GPy.core.Model - :param M: the mass matrix (an identity matrix by default) - :type M: numpy.ndarray - :param stepsize: the step size for HMC sampling - :type stepsize: float - """ self.model = model self.stepsize = stepsize self.p = np.empty_like(model.optimizer_array.copy()) @@ -29,6 +30,7 @@ class HMC: def sample(self, num_samples=1000, hmc_iters=20): """ Sample the (unfixed) model parameters. + :param num_samples: the number of samples to draw (1000 by default) :type num_samples: int :param hmc_iters: the number of leap-frog iterations (20 by default) diff --git a/doc/GPy.inference.optimization.rst b/doc/GPy.inference.optimization.rst index 81fa877a..a81a8e68 100644 --- a/doc/GPy.inference.optimization.rst +++ b/doc/GPy.inference.optimization.rst @@ -4,14 +4,6 @@ GPy.inference.optimization package Submodules ---------- -GPy.inference.optimization.BayesOpt module ------------------------------------------- - -.. automodule:: GPy.inference.optimization.BayesOpt - :members: - :undoc-members: - :show-inheritance: - GPy.inference.optimization.conjugate_gradient_descent module ------------------------------------------------------------ @@ -28,14 +20,6 @@ GPy.inference.optimization.gradient_descent_update_rules module :undoc-members: :show-inheritance: -GPy.inference.optimization.hmc module -------------------------------------- - -.. automodule:: GPy.inference.optimization.hmc - :members: - :undoc-members: - :show-inheritance: - GPy.inference.optimization.optimization module ---------------------------------------------- @@ -44,14 +28,6 @@ GPy.inference.optimization.optimization module :undoc-members: :show-inheritance: -GPy.inference.optimization.samplers module ------------------------------------------- - -.. automodule:: GPy.inference.optimization.samplers - :members: - :undoc-members: - :show-inheritance: - GPy.inference.optimization.scg module ------------------------------------- diff --git a/doc/GPy.inference.rst b/doc/GPy.inference.rst index 2aa7839f..235f804b 100644 --- a/doc/GPy.inference.rst +++ b/doc/GPy.inference.rst @@ -7,6 +7,7 @@ Subpackages .. toctree:: GPy.inference.latent_function_inference + GPy.inference.mcmc GPy.inference.optimization Module contents diff --git a/doc/GPy.testing.rst b/doc/GPy.testing.rst index bef24a30..2d1132d7 100644 --- a/doc/GPy.testing.rst +++ b/doc/GPy.testing.rst @@ -84,14 +84,6 @@ GPy.testing.prior_tests module :undoc-members: :show-inheritance: -GPy.testing.sparse_tests module -------------------------------- - -.. automodule:: GPy.testing.sparse_tests - :members: - :undoc-members: - :show-inheritance: - Module contents ---------------