Skip to content

Commit 6639dff

Browse files
committed
Add some comments
1 parent c7e84fb commit 6639dff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pymc_experimental/gp/pytensor_gp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,15 @@ def conditional_gp(
110110

111111
def _build_conditional(Xnew, f, cov, jitter):
112112
if not isinstance(cov.owner.op, GPCovariance):
113+
# TODO: Look for xx kernels in the ancestors of f
113114
raise NotImplementedError(f"Cannot build conditional of {cov.owner.op} operation")
115+
114116
X, ls = cov.owner.inputs
115117

116118
Kxx = cov
119+
# Kxs = toposort_replace(cov, tuple(zip(xx_kernels, xs_kernels)))
117120
Kxs = cov.owner.op.build_covariance(X, Xnew, ls=ls)
121+
# Kss = toposort_replace(cov, tuple(zip(xx_kernels, ss_kernels)))
118122
Kss = cov.owner.op.build_covariance(Xnew, ls=ls)
119123

120124
L = pt.linalg.cholesky(Kxx + pt.eye(X.shape[0]) * jitter)
@@ -141,7 +145,6 @@ def _build_conditional(Xnew, f, cov, jitter):
141145
else:
142146
raise NotImplementedError("Can only condition on pure GPs")
143147

144-
# TODO: We should write the naive conditional covariance, and then have rewrites that lift it through kernels
145148
mu_star, cov_star = _build_conditional(Xnew, gp_model_var, cov, jitter)
146149
gp_rv_star = pm.MvNormal.dist(mu_star, cov_star, name=f"{gp.name}_star")
147150

0 commit comments

Comments
 (0)