From 1184afad997c663e41be594bd69ce27157c56dfc Mon Sep 17 00:00:00 2001 From: Tom Whitehead Date: Sat, 3 Feb 2024 18:00:15 +0000 Subject: [PATCH 1/2] Correct dl_dm term in student t inference --- .../exact_studentt_inference.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/GPy/inference/latent_function_inference/exact_studentt_inference.py b/GPy/inference/latent_function_inference/exact_studentt_inference.py index 161dd289..440989e1 100644 --- a/GPy/inference/latent_function_inference/exact_studentt_inference.py +++ b/GPy/inference/latent_function_inference/exact_studentt_inference.py @@ -35,15 +35,20 @@ class ExactStudentTInference(LatentFunctionInference): # Log marginal N = Y.shape[0] D = Y.shape[1] - log_marginal = 0.5 * (-N * np.log((nu - 2) * np.pi) - W_logdet - (nu + N) * np.log(1 + beta / (nu - 2))) + log_marginal = 0.5 * ( + -N * np.log((nu - 2) * np.pi) + - W_logdet + - (nu + N) * np.log(1 + beta / (nu - 2)) + ) log_marginal += gammaln((nu + N) / 2) - gammaln(nu / 2) # Gradients dL_dK = 0.5 * ((nu + N) / (nu + beta - 2) * tdot(alpha) - D * Wi) - dL_dnu = -N / (nu - 2.) + digamma(0.5 * (nu + N)) - digamma(0.5 * nu) - dL_dnu -= np.log(1 + beta / (nu - 2.)) + dL_dnu = -N / (nu - 2.0) + digamma(0.5 * (nu + N)) - digamma(0.5 * nu) + dL_dnu -= np.log(1 + beta / (nu - 2.0)) dL_dnu += ((nu + N) * beta) / ((nu - 2) * (beta + nu - 2)) dL_dnu *= 0.5 - gradients = {'dL_dK': dL_dK, 'dL_dnu': dL_dnu, 'dL_dm': alpha} + dL_dm = (nu + N) / (nu + beta - 2) * alpha + gradients = {"dL_dK": dL_dK, "dL_dnu": dL_dnu, "dL_dm": dL_dm} return posterior, log_marginal, gradients From 131da4523c88ca9a0833aaefc5849c827e066a5f Mon Sep 17 00:00:00 2001 From: Martin Bubel Date: Wed, 22 May 2024 09:21:30 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d43591e..2128ab44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +* Correct dl_dm term in student t inference #1065 + ## v1.13.1 (2024-01-14) * limit `scipy<1.12` as macos and linux jobs install some pre-release version of `scipy==1.12` which breaks tests