physbo.blm.inf.exact module

physbo.blm.inf.exact.get_post_fcov(blm, X, Psi=None, diag=True)[ソース]

calculates posterior covariance of model

パラメータ
  • blm (physbo.blm.core.model) --

  • X (numpy.ndarray) -- inputs

  • Psi (numpy.ndarray) -- feature maps (default: blm.lik.linear.basis.get_basis(X))

  • diag (bool) -- if True, returns only variances as a diagonal matrix (default: True)

戻り値

戻り値の型

numpy.ndarray

physbo.blm.inf.exact.get_post_fmean(blm, X, Psi=None, w=None)[ソース]

calculates posterior mean of model

パラメータ
  • blm (physbo.blm.core.model) --

  • X (numpy.ndarray) -- inputs

  • Psi (numpy.ndarray) -- feature maps (default: blm.lik.linear.basis.get_basis(X))

  • w (numpy.ndarray) -- weights (default: get_post_params_mean(blm))

戻り値

戻り値の型

numpy.ndarray

physbo.blm.inf.exact.get_post_params_mean(blm)[ソース]

calculates mean of weight

パラメータ

blm (physbo.blm.core.model) --

戻り値

戻り値の型

numpy.ndarray

physbo.blm.inf.exact.prepare(blm, X, t, Psi=None)[ソース]

initializes auxiaialy parameters for quick sampling

blm.stats will be updated.

パラメータ
  • blm (physbo.blm.core.model) -- model

  • X (numpy.ndarray) -- inputs

  • t (numpy.ndarray) -- target (label)

  • Psi -- feature maps (default: blm.lik.get_basis(X))

physbo.blm.inf.exact.sampling(blm, w_mu=None, N=1, alpha=1.0)[ソース]

draws samples of weights

パラメータ
  • blm (physbo.blm.core.model) -- model

  • w_mu (numpy.ndarray) -- mean of weight

  • N (int) -- the number of samples (default: 1)

  • alpha (float) -- noise for sampling source (default: 1.0)

戻り値

samples of weights

戻り値の型

numpy.ndarray

physbo.blm.inf.exact.update_stats(blm, x, t, psi=None)[ソース]

calculates new auxiaialy parameters for quick sampling by fast-update

パラメータ
  • blm (physbo.blm.core.model) -- model

  • x (numpy.ndarray) -- input

  • t (numpy.ndarray) -- target (label)

  • psi -- feature map (default: blm.lik.get_basis(X))

戻り値

(L, b, alpha) -- new auxially parameters

戻り値の型

Tuple

メモ

blm.stats[0] (L) will be mutated while the others not.