Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing parameter 'nt0' results in a crash #337

Closed
DradeAW opened this issue Feb 12, 2021 · 6 comments · Fixed by #595
Closed

Changing parameter 'nt0' results in a crash #337

DradeAW opened this issue Feb 12, 2021 · 6 comments · Fixed by #595

Comments

@DradeAW
Copy link

DradeAW commented Feb 12, 2021

Hi,

I tried running Kilosort with a different value for nt0 (from 61 to 75), and I obtained this crash:

Unable to perform assignment because the size of the left side is 61-by-1-by-3 and the size of the right side is 75-by-3.

Error in template_learning (line 110)
    rez.W(:,t,:) = gather(wsign * w(:,1:3));

Error in main_kilosort3 (line 42)
rez                = template_learning(rez, tF, st3);

From what I saw, this is because in clustering/template_learning.m, line 103, rez.W is defined as:

rez.W = zeros(61,0, 3, 'single');

Shouldn't this 61 be replaced by ops.nt0?

@marius10p
Copy link
Contributor

Sure, yes, but I think the CUDA code will crash with nt0 >61. Unless your data is recorded at >=50Khz, there shouldn't be a reason to change nt0.

@DradeAW
Copy link
Author

DradeAW commented Feb 12, 2021

I am recording in the cerebellar cortex, and some spikes are called "complex spikes" which impacts the extracellular voltage quite significantly for ~4/5 ms (see the image below, mean of about 5,000 complex spikes)
ex_CS

I was worried that with a short nt0, there would be a residual voltage which might impact Kilosort (as I understand, Kilosort tries to explain the extracellular voltage using the spikes).
Btw, my high-pass filter is set at 150 Hz (I find that 300 Hz makes these complex spikes harder to detect).

@marius10p
Copy link
Contributor

Could you please show that neuron in Phy with multiple snippets? I am curious if multiple events have the same stereotypical pattern after the initial depolarization.

@DradeAW
Copy link
Author

DradeAW commented Feb 12, 2021

The waveforms aren't perfectly aligned (this dataset comes from MountainSort, but I can find one that's from Kilosort where waveforms are more aligned if you want).

Screenshot from 2021-02-08 14-48-20

The positive phase is usually pretty stereotypical for the same neuron.

@marius10p
Copy link
Contributor

This example is very noisy overall. If the positive phase is stereotypical, but the rest of the spike is variable, then Kilosort won't be able to deal with that correctly. In that case, you are better off setting a small nt0, so the clusters don't get split by the variability in the complex part of the spike. It's possible the "tail" of the complex spike will be assigned to a noise unit, which is fine.

@DradeAW
Copy link
Author

DradeAW commented Mar 8, 2021

Alright, thank you!

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 a pull request may close this issue.

2 participants