You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In looking through the main loop of learnAndSolve8b, I'm wondering whether the current traversal through sorted-batches is appropriate. From the how it works section, the first pass is for determining the waveforms, and the second for the final extraction. There's also a gradual annealing of the templates as you traverse over batches. It seems to me that the initial pass only looks at the second half of sorted batch space.
These are all indices into isortbatches, so this is the traversal in sorted batch space. We start halfway in, work our way to the end and then back to the middle. Then we memorizeW and begin the final extraction pass. We work our way out from the middle to the beginning, then revertW back to the middle sorted-batch, and then go forward to the end. The problem, I think, is that the initial pass never looks at the first half of the sorted-batches. I could imagine this being an issue if there are waveforms in the first half of sorted batch space, no clusters will be created for them (via mexGetSpikes2).
Do I understand this correctly or I am misreading the code?
If this is a mistake, I'm not sure how to fix this while preserving continuity across batches in the pass, while also making sure we finish the initial pass on the middle batch. Here's one proposal, but it will make the main loop 25% slower:
After traversing the sorted batches in order, we finish annealing (leave pm equal to its final value), and then head back to the middle batch, where we memorizeW and proceed into the final pass.
The text was updated successfully, but these errors were encountered:
Think of the first pass as an initialization, rather than an optimization. The algorithm forgets at a pretty fast rate what the active templates are, so it won't really matter much to go through the other half of the data for initialization. Only the most recent few hundred spikes from each neuron matter. On data that I've tested, it didn't matter how many back and forth passes we did.
djoshea
added a commit
to djoshea/Kilosort2
that referenced
this issue
Jul 3, 2019
In looking through the main loop of
learnAndSolve8b
, I'm wondering whether the current traversal through sorted-batches is appropriate. From the how it works section, the first pass is for determining the waveforms, and the second for the final extraction. There's also a gradual annealing of the templates as you traverse over batches. It seems to me that the initial pass only looks at the second half of sorted batch space.These are all indices into isortbatches, so this is the traversal in sorted batch space. We start halfway in, work our way to the end and then back to the middle. Then we
memorizeW
and begin the final extraction pass. We work our way out from the middle to the beginning, thenrevertW
back to the middle sorted-batch, and then go forward to the end. The problem, I think, is that the initial pass never looks at the first half of the sorted-batches. I could imagine this being an issue if there are waveforms in the first half of sorted batch space, no clusters will be created for them (viamexGetSpikes2
).Do I understand this correctly or I am misreading the code?
If this is a mistake, I'm not sure how to fix this while preserving continuity across batches in the pass, while also making sure we finish the initial pass on the middle batch. Here's one proposal, but it will make the main loop 25% slower:
After traversing the sorted batches in order, we finish annealing (leave
pm
equal to its final value), and then head back to the middle batch, where wememorizeW
and proceed into the final pass.The text was updated successfully, but these errors were encountered: