gpuicalcc
GPU-accelerated locally centered contrast functions for FastICA. PyTorch extension of icalcc. Same API, drop-in replacement with CUDA acceleration for bounded and polynomial LCC contrasts.
from gpuicalcc import GPUICALCC
ica = GPUICALCC(n_components=4, K='ltanh', device='cuda', random_state=0)
S_hat = ica.fit_transform(X)
Installation
pip install gpuicalcc
Requires PyTorch with CUDA. See pytorch.org for installation instructions.
Supported K Values
| K | Description |
|---|---|
'ltanh' |
Bounded LCC-tanh — 40–48× GPU speedup |
'lexp' |
Bounded LCC-exp — 40–48× GPU speedup |
4 |
Polynomial LCC order 4 |
6 |
Polynomial LCC order 6, couples m₃, m₄, m₆ |
8 |
Polynomial LCC order 8, up to 2.4× GPU speedup at N≥500k |
'tanh' |
Classical logcosh contrast (CPU fallback) |
'exp' |
Classical Gaussian contrast (CPU fallback) |
'skew' |
Classical cube contrast (CPU fallback) |
Bounded contrasts ('ltanh', 'lexp') achieve 40–48× speedup
across all dataset sizes due to the O(NB) pairwise computation
being embarrassingly parallel. Polynomial contrasts benefit from
GPU acceleration at N ≥ 500,000. Classical contrasts fall back
to the CPU implementation in icalcc.
Usage
from gpuicalcc import GPUICALCC
# Bounded LCC-tanh (recommended for heavy-tailed or skewed sources)
ica = GPUICALCC(n_components=4, K='ltanh', device='cuda', random_state=0)
S_hat = ica.fit_transform(X)
# Bounded LCC-tanh with memory limit
ica = GPUICALCC(n_components=4, K='ltanh', device='cuda',
batch_size=500, gpu_mem_limit=8, random_state=0)
S_hat = ica.fit_transform(X)
# Polynomial LCC order 8 (near-Gaussian sources)
ica = GPUICALCC(n_components=4, K=8, device='cuda', random_state=0)
S_hat = ica.fit_transform(X)
# Falls back to CPU automatically if CUDA unavailable
ica = GPUICALCC(n_components=4, K='ltanh', device='cuda', random_state=0)
Parameters
| Parameter | Default | Description |
|---|---|---|
device |
'cuda' |
PyTorch device. Falls back to 'cpu' if CUDA unavailable |
batch_size |
500 |
Subsample size B for bounded pairwise computation |
gpu_mem_limit |
None |
GPU memory limit in GB. Auto-detected if None |
clear_gpu |
True |
Clear GPU cache after fit |
Benchmark
Bounded contrasts (ltanh, lexp) achieve 40–48× speedup across
all dataset sizes. Polynomial contrasts (K=4,6,8) benefit from GPU
acceleration at N ≥ 500,000, reaching up to 2.4× at K=8. All runs
use batch_size=500. Full benchmark table:
Experiment code.
Requirements
- Python ≥ 3.9
- numpy ≥ 1.24
- scikit-learn ≥ 1.3
- icalcc ≥ 0.1.0
- torch ≥ 2.0
See Also
- icalcc — CPU version
- Experiment code
Citation
If you use this package, please cite both the software paper and the underlying LCC kernel paper:
@article{saito2026icalcc,
author = {Saito, Tetsuya},
title = {{ICALCC}: Locally Centered Contrast Functions for
{FastICA} with {GPU} Acceleration},
journal = {TechRxiv},
year = {2026}
}
@article{saito2026lcc,
author = {Saito, Tetsuya},
title = {Locally Centered Cyclic Kernels for Higher-Order
Independent Component Analysis},
journal = {TechRxiv},
year = {2026}
}
License
Release files for gpuicalcc 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gpuicalcc-0.1.5.tar.gz | 6.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gpuicalcc-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.1 kB
Release files / gpuicalcc-0.1.5.tar.gz
| Download URL | gpuicalcc-0.1.5.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94c753169e31359b2579b434a1f3f26d5102c557beca3f9cddd009dbfeaa0ba6
|
|
BLAKE2b-256 checksum How to use checksums |
016020f884d0475ac7f78e486cedac4e937fc5ad40939b075060baa4fb4cac7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / gpuicalcc-0.1.5-py3-none-any.whl
| Download URL | gpuicalcc-0.1.5-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58b1d080fc21979c96a2b076e4c0af0fa8786b314e761633b782b12895b7253e
|
|
BLAKE2b-256 checksum How to use checksums |
dacd5e9f2438c00c5fbc7b65eae77468a0ebb19a43f5f4e3db537f3c8125d9a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|