Skip to content

Kilosort 2 fails on extremely large "spike" trains #85

Description

@brandonStell

KS2 throws an error when it finds a huge number of spikes:

        "Number of spikes before applying cutoff: 36449620",
        "----------------------------------------Error using gpuArray/eig",
        "EIG did not converge at index = 881672."

There is a very easy fix that doesn't appear in the docker and the docker is the only way to run KS2 on later versions of Ubuntu.

Would it be possible to add a container with a try and catch added to runTemplates.m in order to use the economy decomposition when huge spiketrains are found?

    try
        [A, B, C] = svdecon(UA);
    catch
        [A, B, C] = svd(UA,"econ");
    end

The economy-size decomposition removes extra rows or columns of zeros from the diagonal matrix of singular values, S, along with the columns in either U or V that multiply those zeros in the expression A = USV'. Removing these zeros and columns can improve execution time and reduce storage requirements without compromising the accuracy of the decomposition.
https://www.mathworks.com/help/matlab/ref/double.svd.html#d126e1780458

I added this issue to the KS2 repo but I don't have much hope of it being incorporated there now that they are focused on KS4+.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions