Repository navigation
Support offset feature/sample axes in merge functions - #58
Merged
Merged
Conversation
`colnormalize`, `merge_pq`, and `merge_replay` now accept inputs with offset feature (rows of W) and sample (columns of H) axes and carry those axes through to their outputs. The component axis (columns of W, rows of H) is plain enumeration, so it must be one-based and is checked by `check_component_axis`, which throws on a shared/one-based violation. The merge core is axis-generic: components live in a one-based stack with an `alive` mask (rather than empty-vector tombstones), `remix_enact` combines columns by broadcasting, and results are assembled with `stack`, which preserves the data axes. This keeps the column stack a concrete element type so the outputs are type-stable for both plain and offset inputs. Add OffsetArrays as a test dependency and a "generic axes" test set that wraps inputs in OffsetArrays and views, asserts value- and axis-correctness, and uses `@inferred` to lock the output types. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
colnormalize,merge_pq, andmerge_replaynow accept inputs withoffset feature (rows of W) and sample (columns of H) axes and carry those
axes through to their outputs. The component axis (columns of W, rows of H)
is plain enumeration, so it must be one-based and is checked by
check_component_axis, which throws on a shared/one-based violation.The merge core is axis-generic: components live in a one-based stack with an
alivemask (rather than empty-vector tombstones),remix_enactcombinescolumns by broadcasting, and results are assembled with
stack, whichpreserves the data axes. This keeps the column stack a concrete element type
so the outputs are type-stable for both plain and offset inputs.
Add OffsetArrays as a test dependency and a "generic axes" test set that
wraps inputs in OffsetArrays and views, asserts value- and axis-correctness,
and uses
@inferredto lock the output types.Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com