Adding jaxtyping and small shape improvements to inference - #293
Open
mattlevine22 wants to merge 2 commits into
Open
Adding jaxtyping and small shape improvements to inference#293mattlevine22 wants to merge 2 commits into
mattlevine22 wants to merge 2 commits into
Conversation
mattlevine22
commented
Jul 31, 2026
Collaborator
- Add jaxtyping across Filter/Smoother inference.
- Canonicalize scalar observation/control series from (T,) to (T, 1).
- Preserve (T,) scalar labels for HMMs.
…alues to have final dimension even if scalar
DanWaxman
requested changes
Jul 31, 2026
Comment on lines
+279
to
+288
| if not isinstance(config, HMMConfigs): | ||
| obs_values = _ensure_trailing_event_axis( | ||
| obs_values, | ||
| plate_shapes=plate_shapes, | ||
| ) | ||
| if ctrl_values is not None: | ||
| ctrl_values = _ensure_trailing_event_axis( | ||
| ctrl_values, | ||
| plate_shapes=plate_shapes, | ||
| ) |
Collaborator
There was a problem hiding this comment.
Codex points out (and I agree) that this can be problematic to do before plating; for plate size M and time series length T, if M = T, then shared scalar controls (T,) get promoted to plated controls (T, 1), which gets interpreted as plated. We should either do this later, or raise an error in _ensure_trailing_event_axis for this (rather rare) edge case.
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.