docs: add BlackJAXNUTS section to searches/mcmc.py#52
Merged
Conversation
Extends the MCMC tutorial with a worked example of `af.BlackJAXNUTS` (BlackJAX gradient-based No-U-Turn Sampler), shipped in PyAutoFit #1256. Builds a separate `analysis_jax` with `use_jax=True` so the existing Emcee/Zeus path stays NumPy. Calls `enable_pytrees()` and `register_model(model)` from `autofit.jax.pytrees` (the same mechanism used by the `Nautilus_jax` example) so `model.instance_from_vector` JIT-traces. Also prints the NUTS-specific `samples_info` diagnostics (`ess_min`, `mean_acceptance`, `n_divergent`, `n_logl_evals`) and explains what each means / when to act on them. Refs PyAutoLabs/PyAutoFit#1255 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 task
Collaborator
Author
|
Companion: PyAutoLabs/autofit_workspace_test#23 |
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.
Summary
scripts/searches/mcmc.pywith a worked example ofaf.BlackJAXNUTS— BlackJAX's No-U-Turn Sampler, shipped in PyAutoFit #1256.analysis_jaxconstructed withuse_jax=Trueso the existing Emcee / Zeus tutorial paths stay on NumPy. Callsenable_pytrees()+register_model(model)(same mechanism theNautilus_jaxexample uses) somodel.instance_from_vectorJIT-traces.samples_infodiagnostics (ess_min,mean_acceptance,n_divergent,n_logl_evals) with prose explaining what each one means and when a non-zero divergence count should make the user re-run with a tightertarget_accept.__Contents__index to include the new section.Library counterpart: PyAutoLabs/PyAutoFit#1256 (merged).
Issue: PyAutoLabs/PyAutoFit#1255.
Test plan
python scripts/searches/mcmc.py— runs Emcee, Zeus, and BlackJAXNUTS end-to-end without error. BlackJAXNUTS recovers (centre, normalization, sigma) close to (50, 25, 10), ESS comfortably above 100, 0 divergences.🤖 Generated with Claude Code