From 5efa37c9726fbf8d5a97ab4f336de555a5410c90 Mon Sep 17 00:00:00 2001 From: William Wilkinson Date: Mon, 6 Mar 2023 14:40:35 +0000 Subject: [PATCH] generalise partial gauss-newton but dont use it as default --- bayesnewton/likelihoods.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bayesnewton/likelihoods.py b/bayesnewton/likelihoods.py index 6848e09..5856e9c 100644 --- a/bayesnewton/likelihoods.py +++ b/bayesnewton/likelihoods.py @@ -171,7 +171,7 @@ def gauss_newton(self, y, f): log_target = -0.5 * V.T @ V + self.log_normaliser(f) jacobian = -J.T @ V + ZJ # hessian_approx = -J.T @ J + self.log_normaliser_hessian(f) - hessian_approx = -J.T @ J - np.diag((ZJ**2).flatten()) + hessian_approx = -J.T @ J - ZJ @ ZJ.T # second_order_term = -H.T * V return log_target, jacobian, hessian_approx # , second_order_term @@ -1241,7 +1241,7 @@ def conditional_moments(self, f): return conditional_expectation, conditional_covariance -class HeteroscedasticNoise(MultiLatentLikelihood, PartialGaussNewtonMixin): +class HeteroscedasticNoise(MultiLatentLikelihood, GaussNewtonMixin): """ The Heteroscedastic Noise likelihood: p(y|f1,f2) = N(y|f1,link(f2)^2)