hippylib2muq.interface package

Submodules

hippylib2muq.interface.gaussian module

This module provides a set of wrappers that expose some functions of hippylib (the prior Gaussian distributions and the low-rank based Laplace approximation to the posterior distribution) to muq.

class hippylib2muq.interface.gaussian.BiLaplaceGaussian(hp_prior, use_zero_mean=False)

Bases: muq.Modeling.PyGaussianBase

The prior Gaussian distribution with Laplacian-like covariance operator

A class interfacing between hippylib::BiLaplacianPrior and muq::GaussianBase.

ApplyCovSqrt(x)

Apply the square root of covariance matrix to x.

Parameters

x (numpy::ndarray) – input vector

ApplyCovariance(x)

Apply the covariance matrix to x.

Parameters

x (numpy::ndarray) – input vector

ApplyPrecSqrt(x)

Apply the square root of precision matrix to x.

Parameters

x (numpy::ndarray) – input vector

ApplyPrecision(x)

Apply the precision matrix to x.

Parameters

x (numpy::ndarray) – input vector

SampleImpl(inputs)

Draw a sample from the prior distribution. This is an overloaded function of muq::PyGaussianBase The argument inputs is not used, but should be given when SampleImpl is called.

Parameters

inputs (numpy::ndarray) – input vector

class hippylib2muq.interface.gaussian.LAPosteriorGaussian(lapost, use_zero_mean=False)

Bases: muq.Modeling.PyGaussianBase

Low-rank based Laplace approximation to the posterior distribution

A class interfacing between hippylib::GaussianLRPosterior and muq:PyGaussianBase.

ApplyCovSqrt(x)

Apply the square root of covariance matrix to x.

Parameters

x (numpy::ndarray) – input vector

ApplyCovariance(x)

Apply the covariance matrix to x.

Parameters

x (numpy::ndarray) – input vector

ApplyPrecision(x)

Apply the precision matrix to x.

Parameters

x (numpy::ndarray) – input vector

SampleImpl(inputs)

Draw a sample from the approximated posterior distribution. This is an overloaded function of muq::PyGaussianBase.

Parameters

inputs (numpy::ndarray) – input vector

class hippylib2muq.interface.gaussian.LaplaceGaussian(hp_prior, use_zero_mean=False)

Bases: muq.Modeling.PyGaussianBase

The prior Gaussian distribution with Laplacian-like covariance operator

An interface class between hippylib::LaplaceGaussian and muq::GaussianBase. This class is appropriate for 1D (parameter) problems.

ApplyCovariance(x)

Apply the covariance matrix to x.

Parameters

x (numpy::ndarray) – input vector

ApplyPrecision(x)

Apply the precision matrix to x.

Parameters

x (numpy::ndarray) – input vector

SampleImpl(inputs)

Draw a sample from the prior distribution. This is an overloaded function of muq::PyGaussianBase. The argument inputs is not used, but should be given when SampleImpl is called.

Parameters

inputs (numpy::ndarray) – input vector

hippylib2muq.interface.modpiece module

This module provides a set of wrappers that bind some hippylib functionalities such that they can be used by muq.

Please refer to ModPiece for the detailes of member functions defined here.

class hippylib2muq.interface.modpiece.LogBiLaplaceGaussian(prior)

Bases: muq.Modeling.PyModPiece

Log-bi-Laplace prior

This class evaluates log of the bi-Laplacian prior.

EvaluateImpl(inputs)

Evaluate the log of bi-Laplacian prior.

Parameters

inputs (numpy::ndarray) – input vector

class hippylib2muq.interface.modpiece.Param2LogLikelihood(model)

Bases: muq.Modeling.PyModPiece

Parameter to log-likelihood map

This class implements mapping from parameter to log-likelihood.

ApplyHessianImpl(outWrt, inWrt1, inWrt2, inputs, sens, vec)

Apply Hessian to vec for given sens and inputs.

Parameters
  • outWrt (int) – output dimension; should be 0

  • inWrt1 (int) – input dimension; should be 0

  • inWrt2 (int) – input dimension; should be 0

  • inputs (numpy::ndarray) – parameter values

  • sens (numpy::ndarray) – sensitivity values

  • vec (numpy::ndarray) – input vector Hessian applies to

ApplyJacobianImpl(outDimWrt, inDimWrt, inputs, vec)

Apply Jacobian to vec for given inputs.

Parameters
  • outDimWrt (int) – output dimension; should be 0

  • inDimWrt (int) – input dimension; should be 0

  • inputs (numpy::ndarray) – parameter values

  • vec (numpy::ndarray) – input vector Jacobian applies to

EvaluateImpl(inputs)

Evaluate the log-likelihood for given inputs.

Parameters

inputs (numpy::ndarray) – parameter values

GradientImpl(outDimWrt, inDimWrt, inputs, sens)

Compute gradient; apply the transpose of Jacobian to sens for given inputs.

Parameters
  • outDimWrt (int) – output dimension; should be 0

  • inDimWrt (int) – input dimension; should be 0

  • inputs (numpy::ndarray) – parameter values

  • sens (numpy::ndarray) – input vector the transpose of Jacobian applies to

JacobianImpl(outDimWrt, inDimWrt, inputs)

Compute the Jacobian for given inputs.

Parameters
  • outDimWrt (int) – output dimension; should be 0

  • inDimWrt (int) – input dimension; should be 0

  • inputs (numpy::ndarray) – parameter values

class hippylib2muq.interface.modpiece.Param2obs(model)

Bases: muq.Modeling.PyModPiece

Parameter to observable map

This class implements mapping from parameter to observations.

EvaluateImpl(inputs)

Evaluate the observations for given inputs.

Parameters

inputs (numpy::ndarray) – parameter values

GradientImpl(outDimWrt, inDimWrt, inputs, sens)

Compute gradient; apply the transpose of Jacobian to sens.

Parameters
  • outDimWrt (int) – output dimension; should be 0

  • inDimWrt (int) – input dimension; should be 0

  • inputs (numpy::ndarray) – parameter values

  • sens (numpy::ndarray) – input vector the transpose of Jacobian applies to

Module contents