Skip to content

How to only compute diagonal of exact posterior distribution #2312

Discussion options

You must be logged in to vote

Nope, you're already doing the right thing!

By default in GPyTorch, covariance matrices are evaluated and passed around lazily as LinearOperators. Thus, pred.lazy_covariance_matrix is an object that represents the full covariance matrix, but doesn't consume the memory or compute time required to build the whole thing. Calling pred.variance will only get you the diagonal. It's only if you start asking for e.g. off diagonal elements or functions of the covariance matrix that require the whole thing that we start building covariances.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jccalvojackson
Comment options

Answer selected by jccalvojackson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants