Skip to main content

GPU-accelerated locally centered contrast functions for FastICA

Project description

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

GPU 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

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

CC BY 4.0

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

gpuicalcc-0.1.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpuicalcc-0.1.3-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file gpuicalcc-0.1.3.tar.gz.

File metadata

  • Download URL: gpuicalcc-0.1.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for gpuicalcc-0.1.3.tar.gz
Algorithm Hash digest
SHA256 aa05c35e01dd5b75c418e6df59ea01a58efc616fb17be62ffb59a245c75129ff
MD5 52aa6721cfb96c4009e20f0d02c67051
BLAKE2b-256 8f6063dac0f43e34fb6c6115ecfaa98da3f81de867914ab24e3ebabbc6f00afc

See more details on using hashes here.

File details

Details for the file gpuicalcc-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: gpuicalcc-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for gpuicalcc-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 23c30bdbbc6ca9cf1ff64eddf9174cc1b4974f6f8dfaadbd196a4cda88ed0eaf
MD5 b8a0c7c7f1d1aabe88c7036c1de41071
BLAKE2b-256 9acc1a37e4a482fe43fc25ba9901841e7084a01c47922ffa114eaca60b580e36

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