Git Product home page Git Product logo

spikesorting_tsne's Introduction

spikesorting_tsne

This is the repository for the python part of the conda python package that allows running the results of automated spike sorting algorithms through the t-SNE algorithm obtaining a 2D or 3D embedding of the spikes.

Although this package offers some functionality dedicated to spikesorting the t-SNE part of it is kept separate and can be run with any matrix of samples x features.

The package is split into two parts. The python part (in this repo) has the following functionality:

  1. It has the main function through which the whole algorithm is called.
  2. The main function wraps the C++ executable (Barnes_Hut.exe) and calls it appropriately.
  3. It uses numba gpu to create the spike (or any other sample matrix) distances.
  4. It offers functions that operate on the result of the kilosort spikesorting algorithm to create the required samples (spikes) x features (template distances) matrix for t-SNE to run on.
  5. It offers functions that allow the user to split a dataset of spikes that is too lrage for the algorithm to sub groups that can be seperately run and then recombined (uses information generated by ythe kilosort algorithm)

The C++ part (which generates the Barnes_Hut.exe executable) can be found here.

How it works

Firstly the main function calls the python implimented (in numba) GPU part. This uses the GPU to do two things. First to calculate the distances of every sample (spike) to every other sample and then to sort in ascending order the distances from each sample and keep the 3 * perplexity nearest neighbours. These results together with the t-SNE parameters specified by the user are then saved to disk (data.dat file).

Secondly the algorithm calls the Barnes_Hut.exe which operates on this file going over the t-SNE loop (as described by van der Maaten). The results are finally saved to disk.

For a description of the parameters of the t-SNE algorithm see the van der Maatens repository and the scipy implementation.

Capabilities

This t-SNE implementation is significantly improved in speed and input size compared to the standard C++ code or to the scipy implementation. It can operate on datasets of more than 1 million samples. On a Titan X GPU and i7 CPU it solves a 1M samples dataset for 2000 iterations (with theta = 0.4) in about 3 days.

There is no limitation to the required RAM but an increase in sample size will increase the time of the solution in a linear way for the GPU part and in a super linear way (not exponentially though) for the CPU / Barnes hut part.

More info

More detailed documentation can be found in the Github Pages of this repo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.