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

mexGetSpikes2 returns a 2-dimensional result in learnTemplates #218

Closed
ckemere opened this issue Jul 16, 2020 · 1 comment · Fixed by #595
Closed

mexGetSpikes2 returns a 2-dimensional result in learnTemplates #218

ckemere opened this issue Jul 16, 2020 · 1 comment · Fixed by #595

Comments

@ckemere
Copy link

ckemere commented Jul 16, 2020

I've been dealing with issues related to trying to sort data with not-so great (i.e., lower amplitude and somewhat sparse) firing neurons recorded using Buzsaki-style Neuronexus probes over a long period.

I changed the threshold parameters ops.spkTh = -5, ops.ThPre = 3, and ops.Th = [3, 2] to deal with the fact that I was getting a lot of Batch XX has fewer than Nfilt spikes. errors, and succeeded in getting up to the learnAndSolve8b() function without errors or warnings. However, I discovered that things are now breaking right at the beginning, and it appears to be because mexGetSpikes2 is not returning any spikes.

It revealed an odd bug (?), which is that size(dWU,3) = 1 even though the size returns as 61 8 (which is dimension 2, not 3!). Any thoughts on why mexGetSpikes2 wouldn't return spikes when the initial clustering seems to be working fine?

thanks!

    if ibatch==1
       % only on the first batch, we first get a new set of spikes from the residuals,
       % which in this case is the unmodified data because we start with no templates
        [dWU, cmap] = mexGetSpikes2(Params, dataRAW, wTEMP, iC-1); % CUDA function to get spatiotemporal clips from spike detections
        W = W0(:,ones(1,size(dWU,3)),:); % initialize the low-rank decomposition with standard waves
        Nfilt = size(W,2); % update the number of filters/templates
        nsp(1:Nfilt) = m0; % initialize the number of spikes for new templates with the minimum allowed value, so it doesn't get thrown back out right away
        Params(2) = Nfilt; % update in the CUDA parameters
    end
@JoseGuzman
Copy link
Contributor

JoseGuzman commented Jul 24, 2020

The same problem here for a similar issue with very sparse recordings (i.e, low number of spikes) and set ops.minFR very low (1/600). Clustering fails in commit ab9c339 (on May 4, 2020). Until commit 48bf2b8 everything works OK.

I got tons of 'Batch x has fewer than Nfilt spikes' ` messages and the following error

One or more output arguments not assigned during call to "mexMPnu8".

Error in learnTemplates (line 149)
        mexMPnu8(Params, dataRAW, single(U), single(W), single(mu), iC-1, iW-1, UtU, iList-1, ...

Error in learnAndSolve8b (line 15)
    rez     = learnTemplates(rez, iorder0);

Error in master_kilosort (line 53)
rez = learnAndSolve8b(rez);

In my case, the size of dWU returns:

K>> size(dWU)

ans =

    61    62     0

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