Likelihood

This section contains some utilties for defining the of the observations

Likelihood base class

class svise.sde_learning.Likelihood[source]

Abstract base class defining the likelihood of the observations given specifc state.

abstract mean_log_likelihood(t: Tensor, x: Tensor, marginal_sde: MarginalSDE, n_reparam_samples: int, **kwargs) Tensor[source]

Computes the mean log-likelihood for a batch of data. When closed form is not available, this is approximated by sampling from the marginal SDE.

Parameters:
  • t (Tensor) – (bs, ) time stamps of measurements

  • x (Tensor) – (bs, D) measurements

  • marginal_sde (MarginalSDE) – marginal stochatic differential equationdefining the approximate posterior

  • n_reparam_samples (int) – number of reparam samples to use when closed form is not available (ignored otherwise)

Returns:

mean log-likelihood for batch of data

Return type:

Tensor

abstract pretrain_log_like(t: Tensor, x: Tensor, marginal_sde: MarginalSDE) Tensor[source]
Loss used to pretrain marginal SDE

t (Tensor): time stamps x (Tensor): observations marginal_sde (MarginalSDE): Markov GP definition

Returns:

log-likelihood of observations

Return type:

Tensor

Diagonal Gaussian likelihood

class svise.sde_learning.IndepGaussLikelihood(g: Callable | Tensor, d: int, measurement_noise: Tensor)[source]

Likelihood for the case that the observations are drawn from a diagonal Gaussian.

Parameters:
  • g (Union[Callable, Tensor]) – observation function / matrix

  • d (int) – number of states

  • measurement_noise (Tensor) – observation variance

mean_log_likelihood(t: Tensor, x: Tensor, marginal_sde: MarginalSDE, n_reparam_samples: int) Tensor[source]

Computes the mean log-likelihood for a batch of data. When g is nonlinear, this is approximated by sampling from the marginal SDE.

Parameters:
  • t (Tensor) – (bs, ) time stamps of measurements

  • x (Tensor) – (bs, D) measurements

  • marginal_sde (MarginalSDE) – marginal stochatic differential equation defining the approximate posterior

  • n_reparam_samples (int) – number of reparam samples to use when closed form is not available (ignored otherwise)

Returns:

mean log-likelihood for batch of data

Return type:

Tensor

pretrain_log_like(t: Tensor, x: Tensor, marginal_sde: MarginalSDE) Tensor[source]
Loss used to pretrain marginal SDE

t (Tensor): time stamps x (Tensor): observations marginal_sde (MarginalSDE): Markov GP definition

Returns:

log-likelihood of observations

Return type:

Tensor