Add a fast test for the disentangled spatiotemporal SSM - #2624
Merged
Conversation
The test added in #2128 took over an hour: 8 subjects x 8 time points at 512 particles with 1000 iterations per split. It now runs 128 particles for 300 iterations and finishes in about 11 seconds while reaching the same model quality as the original. Instead of asserting absolute eigenvalues, the test uses the structure of the fixture: each subject is an ellipsoid whose X radius is fixed per subject and whose Y radius follows a trajectory shared by every subject, so within a time point the subjects differ by a single linear mode. The first PCA mode explaining nearly all of the across-subject variance is therefore a direct measure of correspondence, and it is scale free. It reaches ~0.99 here and falls below 0.2 when correspondence is lost. The per-subject objective matrix was also sized by the number of subjects rather than the number of time points, so any dataset with more time points than subjects aborted. The original fixture is 8x8, which hid it. Fixed, and covered by a second test with a deliberately unequal dataset. The project fixture is now a .swproj rather than a binary .xlsx, and the 128 checked-in particle files that the run regenerates anyway have been dropped. Co-authored-by: Nawazish Khan <nawazishkhan1.nk@gmail.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.
Supersedes #2128 (for #2122), picking up @nawazishkhan1-nk's stalled test, which now conflicts with master.
The test took over an hour: 8x8 shapes at 512 particles, 1000 iterations per split. It now runs 128 particles for 300 iterations in about 11 seconds, at the same model quality.
Absolute eigenvalue thresholds are replaced by one grounded in the fixture. Each subject is an ellipsoid with a fixed X radius and a shared Y-radius trajectory, so within a time point the subjects differ by exactly one linear mode. The first PCA mode's variance fraction is then a scale-free measure of correspondence — ~0.99 here, below 0.2 when it is lost. It also asserts the mode is
DisentagledEnsembleEntropy, so the feature can't silently fall back.Also fixes a crash:
ComputeCovarianceMatrices()sizes the per-subject matrix by subject count but fills it by time point count, so more time points than subjects aborts. The 8x8 fixture hid it; a second test uses 4x8.The fixture is now a
.swprojrather than a binary.xlsx, minus 128 regenerated particle files.