Skip to content

arthur-pe/slicetca

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SliceTCA

This library provides tools to perform sliceTCA.


Installation

pip install slicetca

Full documentation

The full documentation can be found here.

Examples

Quick example

import slicetca
import torch
from matplotlib import pyplot as plt

device = ('cuda' if torch.cuda.is_available() else 'cpu')

# your_data is a numpy array of shape (trials, neurons, time).
data = torch.tensor(your_data, dtype=torch.float, device=device)

# The tensor is decomposed into 2 trial-, 0 neuron- and 3 time-slicing components.
components, model = slicetca.decompose(data, (2,0,3))

# For a not positive decomposition, we apply uniqueness constraints
model = slicetca.invariance(model)

slicetca.plot(model)

plt.show()

Notebook

See the example notebook for an application of sliceTCA to publicly available neural data.

Open In Colab

Reference

A. Pellegrino@, H. Stein, N. A. Cayco-Gaijc@. (2024). Dimensionality reduction beyond neural subspaces with slice tensor component analysis. Nature Neuroscience https://www.nature.com/articles/s41593-024-01626-2.

About

Library to perform Slice Tensor Component Analysis (sliceTCA)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published