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

Limit the number of clusters #67

Closed
PhantomSpike opened this issue May 19, 2019 · 5 comments · Fixed by #595
Closed

Limit the number of clusters #67

PhantomSpike opened this issue May 19, 2019 · 5 comments · Fixed by #595

Comments

@PhantomSpike
Copy link

Hi,

I find that I get a bit too many clusters and end up having to merge or discard a significant number.

Is there a way to limit how many templates are initialized and used in the optimization process? In Kilosort 1 this was done via the ops.Nfilt parameter.

In Kilosort 2 this parameter also exists under the same name:

ops.Nfilt = 1024; % max number of clusters

However, even though I set it to e.g. 480 (32*15 so still multiple of 32) I ended up with 732 clusters. Is that because in the splitting stage KS2 found that it was better to split these clusters even though it started with 480?

Thanks!

@marius10p
Copy link
Contributor

Probably. What was the output of Kilosort2 towards the end of the optimization? Split units will have a similarity of exactly "1" in Phy.

You can reduce splitting propensity by increasing ccsplit, i.e. making the separation criterion for splitting more stringent.

@Alkohost
Copy link

Alkohost commented Aug 16, 2019

Can I set ops.Nfilt=5 for example if I use 32 channels and sure about maximal number of clusters?

@marius10p
Copy link
Contributor

Yes, but it will still do splits and merges at the end which might increase your number.

@DemetrisS
Copy link

Hello

I am having a similar issue with KS3 when running on data from a 24Ch linear probe (Uprobe) - I am ending with >120 clusters, often >200. I have tried changing "ops.Nfilt" with little effect. I have also played a bit with the AUCsplit (using values from 0.5 to 0.99) with little effect on cluster numbers - any advice would be most welcome.

Many thanks
D

@JonathanAMichaels
Copy link

ops.Nfilt isn't actually used. It's defined in preprocessDataSub.m:

ops.Nfilt = getOr(ops, 'nfilt_factor', 4) * ops.Nchan; % upper bound on the number of templates we can have

so you would have to change ops.nfilt_factor if you want to set an upper limit.

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.

5 participants