Skip to content

Commit

Permalink
generalise partial gauss-newton but dont use it as default
Browse files Browse the repository at this point in the history
  • Loading branch information
William Wilkinson committed Mar 6, 2023
1 parent 21e533c commit 5efa37c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bayesnewton/likelihoods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5efa37c

Please sign in to comment.