Skip to content

Add whitening_seed parameter to MountainSort5#4600

Merged
chrishalcrow merged 1 commit into
SpikeInterface:mainfrom
grahamfindlay:feature/ms5-seed
Jun 1, 2026
Merged

Add whitening_seed parameter to MountainSort5#4600
chrishalcrow merged 1 commit into
SpikeInterface:mainfrom
grahamfindlay:feature/ms5-seed

Conversation

@grahamfindlay
Copy link
Copy Markdown
Contributor

@grahamfindlay grahamfindlay commented May 31, 2026

MountainSort5 whitens the recording before sorting, and the whitening matrix is estimated from randomly-selected data chunks (spikeinterface.preprocessing.whiten -> get_random_data_chunks).

Without control of the seed, sorting isn't reproducible, even on identical input.

Added a whitening_seed parameter (default None, preserves current behavior) that is forwarded to whiten(seed=...).

There is still some very, very small residual indeterminism (on my test recording: 100% of units match, but ~0.04% of spikes differ) between runs with identical input. Not sure where it comes from -- maybe BLAS multithreading? Not worried about it.

Looks okay @magland ?

(The reason I'm trying to get deterministic output is so that I can evaluate whether the lossy WavPack(bps=2.25) compression that has negligible impact on Neuropixel sortings is also safe for some tetrode recordings. @alejoe91 )

MountainSort5 whitens the recording before sorting, and the
whitening matrix is estimated from randomly-selected data chunks
(spikeinterface.preprocessing.whiten -> get_random_data_chunks).

Without control of the seed, sorting isn't reproducible, even on
identical input.

Added a `whitening_seed` parameter (default None, preserves current behavior)
that is forwarded to whiten(seed=...).

There is still some very small residual indeterminism (on my test
recording: 100% of units match, but ~0.04% of spikes differ) between
runs with identical input. Not sure where it comes from -- maybe BLAS
multithreading?
Copy link
Copy Markdown
Member

@chrishalcrow chrishalcrow left a comment

Choose a reason for hiding this comment

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

LGTM

@magland
Copy link
Copy Markdown
Member

magland commented Jun 1, 2026

Looks good, thanks!

@chrishalcrow chrishalcrow merged commit e9b764f into SpikeInterface:main Jun 1, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants