gPAC: GPU-Accelerated Phase-Amplitude Coupling
gPAC is a PyTorch-based package for efficient computation of Phase-Amplitude Coupling (PAC) metrics with GPU acceleration.
Key Features
- GPU Acceleration: 5-100x faster PAC computation via PyTorch/CUDA
- Differentiable Filters: Optional gradient flow for integration with deep learning models
- Synthetic Data Generation: Built-in tools for generating test signals with known PAC properties
- Statistical Analysis: Permutation testing and surrogate distributions for validation
- Return Full Distributions: Access complete surrogate data for custom statistical analyses
Quick Start
# Installation
git clone https://github.com/[username]/gPAC.git
cd gPAC
pip install -e .
# Basic usage
import torch
import gpac
import numpy as np
# Create example data (batch_size, channels, segments, time)
signal = torch.randn(2, 4, 1, 1024)
# Calculate PAC with GPU acceleration
pac_values, pha_freqs, amp_freqs = gpac.calculate_pac(
signal=signal,
fs=256.0, # Sampling frequency
pha_n_bands=10, # Number of phase bands
amp_n_bands=10, # Number of amplitude bands
device="cuda", # Use GPU
n_perm=200, # Permutation testing
)
Documentation
For detailed usage examples and API reference, see:
examples/directory for sample scriptssrc/gpac/README.mdfor implementation details- Docstrings in the source code for function parameters
Contact
Yusuke Watanabe (ywatanabe@alumni.u-tokyo.ac.jp)
Metadata
Release files for torch-pac 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| torch_pac-0.1.0.tar.gz | 34.2 kB | Without provenance | Details for torch_pac-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| torch_pac-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for torch_pac-0.1.0-py3-none-any.whl |
Total release size: 79.4 kB
Release files / torch_pac-0.1.0.tar.gz
| Download URL | torch_pac-0.1.0.tar.gz |
|---|---|
| Size | 34.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
832f03f0c11aeb025fb7a11218dcc2a87132df215c9eee483972f0ad22419eff
|
|
BLAKE2b-256 checksum How to use checksums |
269c1e639899bbc83027f237419a54ead3b148a4f76c9b7d0731ff121c3ad47e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.4
|
Release files / torch_pac-0.1.0-py3-none-any.whl
| Download URL | torch_pac-0.1.0-py3-none-any.whl |
|---|---|
| Size | 45.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ac8db11ef665e8402d1d950bd01e9736aab451c5b7d1d73666a7c320a29370e
|
|
BLAKE2b-256 checksum How to use checksums |
b9d8f7a9ba8aa28345aaff8afc2ffa37711447221ee79de4f4a0be15cc925afc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.4
|
Security for torch-pac 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.