Repository navigation
docs(oilmm): state the interleaved output ordering - #843
Open
thomaspinder wants to merge 2 commits into
Open
thomaspinder wants to merge 2 commits into
thomaspinder wants to merge 2 commits into
Conversation
OILMMPosterior.__call__ flattens its predictive mean and covariance with index n * P + p (test input n, output p). The docstring called this "output-major" and gave the covariance formula for the blocked ordering (index p * N + n). State the interleaved ordering and give the formulas that match it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
OILMMPosterior.__call__flattens the predictive mean and covariance with indexn * P + p(test inputn, outputp). The docstring said "output-major". It also gave the covariance as(H ⊗ I) Σ (H ⊗ I)ᵀ, which is the formula for the blocked ordering (indexp * N + n). Thus the documentation and the code did not agree.In other GPJax code, "output-major" means the blocked ordering (
MultiOutputGaussian,ExactPosterior, the ICM and LCM kernels). Thus the old docstring told users the opposite of what the code does.Solution
This PR changes only docstrings, comments and documentation text. It does not change behaviour.
n * P + p, and thatmean.reshape(N, P)gives one row for each test input.ExactPosteriorand the ICM and LCM kernels.vec(H Λ), covarianceΣ_m Σ_m ⊗ h_m h_mᵀ = (I_N ⊗ H) Σ̃ (I_N ⊗ H)ᵀ, and marginal varianceΣ_m H_pm² [Σ_m]_nn. I checked each formula numerically against the dense and diagonal output.A change of the code to the blocked ordering is not part of this PR. The interleaved ordering is in the v1.0.0 and v1.1.0 releases, and the OILMM example notebook uses it (
pred.mean.reshape(N_test, num_outputs)). A change would give silently wrong values to code that reshapes the output, so it needs a decision and a CHANGELOG entry.The PR also corrects the same term in two other places:
docs/migration.md("flattened output-major") and a comment intests/test_models_oilmm.py.Verification
All three pass.
🤖 Generated with Claude Code