perf(postprocessing): compute only the amplitude scaling coefficients - #4764
Open
JESUSROYETH wants to merge 1 commit into
Open
perf(postprocessing): compute only the amplitude scaling coefficients#4764JESUSROYETH wants to merge 1 commit into
JESUSROYETH wants to merge 1 commit into
Conversation
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.
amplitude_scalingscallslinregressper ordinary spike and creates aLinearRegressionper collision, although only the fitted coefficients are used. This computes unused statistics and repeats estimator validation inside the per-spike loop.This change computes the ordinary slope directly from centered covariance/variance in float64, and calls
scipy.optimize.nnlsdirectly for collisions. The float64 accumulation avoids the SciPy-version-dependent float32 rounding found during validation, while the collision path keeps the same intercept and non-negative constraint.On a 384-channel, 200-unit, 120-second analyzer with 191,674 spikes (
n_jobs=1), the public pipeline that feedsvalid_unit_periodswent from 110.224 s median (107.983–111.503) to 45.757 s (45.666–45.815), or 2.41x. The 191,674 scalings and collision flags were bit-identical. A public Spike2 recording with 23,096 events and 2,140 collision fits went from 9.386 s to 1.017 s (9.23x), also bit-identical. The focused tests pass, 9 of 9.