Skip to content

Review LOO-PL implementation for consistency/clarity/accuracy #5

@sgbaird

Description

@sgbaird

Related reading shared by Willi, for myself to review: https://gaussianprocess.org/gpml/chapters/RW.pdf

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()

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions