Skip to main content

Package to perform Slice Tensor Component Analysis

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slicetca-1.0.4.tar.gz (18.0 kB view details)

Uploaded Source

File details

Details for the file slicetca-1.0.4.tar.gz.

File metadata

  • Download URL: slicetca-1.0.4.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for slicetca-1.0.4.tar.gz
Algorithm Hash digest
SHA256 26c8905bbba329565f3eb6292a57834c4c27ab6f21e3a5e441b116b886ffa4ff
MD5 df173f5f5ea0ee96f8ce40ef11f0834c
BLAKE2b-256 c12b7a4620c3f0e60df30b703a4d3c48812b6cdaf82456a73e0d1b56f82a476b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page