runlmc.lmc.stochastic_deriv module

class runlmc.lmc.stochastic_deriv.StochasticDeriv(alpha, rs, inv_rs, n_it)[source]

Bases: runlmc.lmc.derivative.Derivative

Given the inverse of random binary vectors inv_rs with respect to some kernel \(K\) and the similar inverse alpha of observations \(K^{-1}y\), this class produces the derivatives of \(K\) with respect to its hyperparameters.

d_logdet_K(dKdt)[source]
d_normal_quadratic(dKdt)[source]
class runlmc.lmc.stochastic_deriv.StochasticDerivService(metrics, pool, n_it, tol)[source]

Bases: object

This service generates runlmc.lmc.Derivative instances with pre-specified configurations for recording metrics or using multiprocessing, which enables decoupling of the math from the systems in the GP logic.

Parameters:
  • metrics – a runlmc.lmc.metrics.Metrics instance or None (if no metrics are to be recorded)
  • pool – pool for parallel processing
  • n_it – iterations to use in stochastic trace approximation
  • tol – tolerance in inversion routine
Variables:

metrics – the metrics instance used by this class

generate(K, y)[source]