Skip to content

docs: document NUTS regularize_mass_matrix#2214

Merged
juanitorduz merged 2 commits into
pyro-ppl:masterfrom
ahfoysal:docs/nuts-regularize-mass-matrix
Jul 7, 2026
Merged

docs: document NUTS regularize_mass_matrix#2214
juanitorduz merged 2 commits into
pyro-ppl:masterfrom
ahfoysal:docs/nuts-regularize-mass-matrix

Conversation

@ahfoysal

@ahfoysal ahfoysal commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What

Adds the missing regularize_mass_matrix parameter description to the NUTS docstring. The wording matches the existing HMC/internal initializer docs and the argument already exposed by the NUTS constructor.

Closes #2198.

Tests

  • Checked that the NUTS docstring now includes regularize_mass_matrix
  • git diff --check
  • uvx ruff check numpyro/infer/hmc.py
  • uvx ruff format --check numpyro/infer/hmc.py

@juanitorduz juanitorduz added documentation enhancement New feature or request and removed enhancement New feature or request labels Jul 7, 2026

@juanitorduz juanitorduz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but we need to move this to the bottom ;)

Comment thread numpyro/infer/hmc.py Outdated
Comment on lines +873 to +875
:param bool regularize_mass_matrix: whether or not to regularize the estimated mass
matrix for numerical stability during warmup phase. Defaults to True. This flag
does not take effect if ``adapt_mass_matrix == False``.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please put this at the end, matching the order of the arguments in the init function, please?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved it to the bottom to match the constructor order.

@juanitorduz juanitorduz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ahfoysal !

@juanitorduz juanitorduz merged commit c3046df into pyro-ppl:master Jul 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

documentation for regularize_mass_matrix in NUTS missing

2 participants