mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-13 14:03:20 +02:00
adding exact gaussian inference
This commit is contained in:
parent
48c292d263
commit
435cbbc421
1 changed files with 13 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
|
||||||
|
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||||
|
|
||||||
|
def exact_gaussian_inference(K, likelihood, Y, Y_metadata=None):
|
||||||
|
|
||||||
|
|
||||||
|
Wi, LW, LWi, W_logdet = pdinv(K + likelhood.covariance(Y, Y_metadata))
|
||||||
|
|
||||||
|
alpha, _ = dpotrs(LW, YYT_factor, lower=1)
|
||||||
|
dL_dK = 0.5 * (tdot(alpha) - Y.shape[1] * Wi)
|
||||||
|
|
||||||
|
log_marginal = (-0.5 * Y.size * np.log(2.*np.pi) -
|
||||||
|
0.5 * Y.shape[1] * W_logdet + np.sum(np.square(alpha))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue