Skip to content

circus-omp fixes and improvements - #4950

Open
grahamfindlay wants to merge 1 commit into
SpikeInterface:mainfrom
grahamfindlay:circus-omp-duplicate-atoms
Open

grahamfindlay wants to merge 1 commit into
SpikeInterface:mainfrom
grahamfindlay:circus-omp-duplicate-atoms

Conversation

@grahamfindlay

Copy link
Copy Markdown
Collaborator

With the default vicinity=2, circus-omp sometimes picks the same template at the same time twice. The amplitude fit can't tell two these identical atoms apart, so one of two things goes wrong:

  • If the second atom/copy is rejected, the current pass stops early and the spikes it would have found next are dropped, so fewer spikes are found toward the end of each chunk.
  • If the second atom/copy is accepted, its amplitude overwrites the first one, and the spike is either lost or given a huge amplitude.

This PR replaces the windowed amplitude update used when vicinity > 0 with LocOMP (Mailhé et al., ICASSP 2009), which never picks the same template at the same time twice and, after each pick, re-fits the amplitudes of nearby spikes on the same channels to whatever signal is still unexplained. Nothing changes with vicinity=0. Amplitude estimates are improved (which has knock-on effects improving e.g. template re-estimation), recall is improved ~6 pts without loss of precision, with the biggest gains when spikes are dense, and matching is ~10% faster than it was.

With the default vicinity, circus-omp could select a template it had
already selected at the same time. This either cut the matching pass
short, losing later spikes, or overwrote the spike's amplitude,
sometimes with very large values.

Each new selection now re-fits nearby selected templates to what is
left of the signal (LocOMP, Mailhé et al., 2009), and a template is
never selected twice at the same time. This recovers more spikes, gets
rid of the very large amplitudes, and is slightly faster.
@grahamfindlay grahamfindlay added bug Something isn't working sortingcomponents Related to sortingcomponents module labels Nov 17, 2026

@yger yger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me, and I've done some local tests, results seems to be very slightly improved, with no speedup impact. Good catch for the bug! Maybe @samuelgarcia want to also have a look before merging, but it won't be before next week at the latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working sortingcomponents Related to sortingcomponents module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants