Remove GPJax dependency from the test suite#37
Open
bwengals wants to merge 2 commits into
Open
Conversation
Replace the GPJax reference comparisons with self-contained correctness checks so the suite no longer breaks on GPJax API changes (e.g. the 0.15 gram-operator change that required pinning gpjax==0.13.6). - Kernels: compare ExpQuad/Matern52/32 against closed-form analytic references in numpy. Matern uses a looser tolerance to absorb the float32 sqrt(5)/sqrt(3) constant pytensor evaluates in floatX. - Gaussian likelihood: closed-form variational expectation. - Bernoulli likelihood: independent numpy Gauss-Hermite quadrature. - SVGP Bernoulli/Poisson ELBO: reuse the numpy+scipy reference machinery (factored into tests/_svgp_ref.py and shared with the StudentT/NegBinom tests), as the scipy-ref module already anticipated. - Drop gpjax from conda_envs/environment-test.yaml. Closes #36.
… env - Matern52/32 used pt.sqrt(5.0)/pt.sqrt(3.0), which autocasts the literal to float32 regardless of config.floatX, injecting ~1e-7 error into an otherwise float64 kernel. Use pt.constant(..., dtype=config.floatX) so the constant follows the backend's precision; Matern now matches the analytic reference to ~3e-15 in float64. Tighten the kernel test tolerance accordingly. - ptgp, and the test suite after the GPJax removal, never import jax/optax, so drop jax/jaxlib/optax from conda_envs/environment-test.yaml.
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.
Closes #36.
Replaces the GPJax reference comparisons with self-contained correctness checks, so the suite no longer breaks on GPJax API changes (the reason #35 had to pin
gpjax==0.13.6).What changed
test_stationary.py): compared against closed-form analytic references in NumPy.test_svgp.py): reuse the numpy+scipy reference that already backs the StudentT/NegBinom tests, factored intotests/_svgp_ref.py.stationary.py): Matern52/32 usedpt.sqrt(5.0), which autocasts the literal to float32 regardless offloatX. Typed viapt.constant(..., dtype=floatX)so it follows the backend; Matern now matches the reference to ~3e-15. Other kernel literals are float32-exact, so no other changes.gpjax(plus now-unusedjax/jaxlib/optax).Test plan
pytest tests/— 265 passedpre-commit run --all-filescleanscripts/run_mypy.py— 37/37 pass