Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

What is this?

This repository contains the source code for reading out the neural ensemble places code in real-time with GPU. We got 20-50X speedup for decoding of unsorted ensemble place codes. Online real-time (20ms bin) significance assessment (with 1000 shuffle samples) for replay events during sleep is realized with our approuch. More details and results can be found in our Cell Reports paper Real-Time Readout of Large-Scale Unsorted Neural Ensemble Place Codes

files:         - The python script for the demostration of GPU decoding speed up      - The python script for the demostration of online decoding and assessment                 - KDE decoding related python classes                    - tool functions for this demo code             - configuration options

files under gpu_decoder    - CUDA codes and C++ wrappers for decoding with GPU

files under gmmcompression - Cython and C codes for decoding

files under data           - data for testing

files under mixture        - preprocessed mixtures(trained model)

files under fklab_analysistools - fklab python toolbox, for data preprocessing

The codes under gmmcompression,mixture,fklab_analysistools are borrowed from Real Time Replay is modified based on the orignal version in the repo above to adapt to GPU computation

See more about our rearch on our website: Computational Neuroscience, Neuroengineering & Neuropsychiatry Laboratory

Step-by-step setup instructions:

This code has been tested with the following setup:

Operating system: Ubuntu 16.04; Python version: Python2.7.2; CUDA version: 8.0

  1. some packages maybe required to use this toolbox: scipy, numba, pyyaml, h5py, natsort, libgsl They can be installed by pip:
pip install scipy, numba, pyyaml, h5py, natsort

remember add the path to this toolbox into PYTHONPATH. add the following line into ~/.bashrc or ~/.profile, replace path/to/dataanalysispython with your path:

export PYTHONPATH=$PYTHONPATH:"path/to/dataanalysispython"
  1. Intall CUDA toolkit if not installed yet. The download link and instrctions can be found here: Our code was tested with cuda-8.0 version of the toolkit, this or a newer version is recommanded.

  2. add the path to real_time_read_out_GPU/gpu_decoders folder into LD_LIBRARY_PATH. add the following line into ~/.bashrc or ~/.profile, replace path/to/gpu_decoder with your path:

export LD_LIBRARY_PATH=path/to/gpu_decoder:$LD_LIBRARY_PATH
  1. pre-trained models and testing data: download data to the repository folder, and extract the data files in
  1. run and, it takes from 30 seconds to a few minutes to run the decoding process, depending on the hardware.

Compile the binaries by yourself:

This repository is provided with the precompiled shared libraries for ubuntu 64 bit environment. If it doesn't work for you, you can re-compile the shared libraries by yourself.

  1. install libgsl. For ubuntu users, type this command in the terminal:
sudo apt-get install libgsl2
sudo apt-get install libgsl0-dev

For other linux disributions, please refer to the instrutions here:

  1. compile GPU code. Go to gpu_decoders folder, edit makefile for cuda path if necessary, and then type make to compile in the terminal:
cd gpu_decoders

If succeeded, a shared library will be found in this folder

  1. compile Cython interface.

Install Cython if not been installed yet:

pip install cython

Go to gmmcompression folder and compile Cython code:

cd gmmcompression
python install --prefix=.
cp lib/python2.7/site-packages/ .
You can’t perform that action at this time.