-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Related reading shared by Willi, for myself to review: https://gaussianprocess.org/gpml/chapters/RW.pdf
evaluation-metrics/evaluation_metrics.py
Lines 128 to 143 in 68a2be8
| def loo_pseudo_likelihood(model, train_X, train_Y) -> float: | |
| """ | |
| Negative mean leave‑one‑out log‑likelihood (lower is better). | |
| Note: The GPInputWarning about matching training data is expected here | |
| as we're calculating LOO-PL on the training data. Not sure how to deal with the warning... | |
| """ | |
| loo_mll = LeaveOneOutPseudoLikelihood(model.likelihood, model) | |
| # GP output at the training inputs | |
| with torch.no_grad(), fast_pred_var(): | |
| f_dist = model(train_X) | |
| target = train_Y.squeeze(-1) | |
| # average over points | |
| return (-loo_mll(f_dist, target).mean()).item() |
willigottCopilot