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.5.tar.gz (6.5 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.5-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gpuicalcc-0.1.5.tar.gz
  • Upload date:
  • Size: 6.5 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.5.tar.gz
Algorithm Hash digest
SHA256 94c753169e31359b2579b434a1f3f26d5102c557beca3f9cddd009dbfeaa0ba6
MD5 cd6c00df87a79e6b3e6873e292c416b3
BLAKE2b-256 016020f884d0475ac7f78e486cedac4e937fc5ad40939b075060baa4fb4cac7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gpuicalcc-0.1.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 58b1d080fc21979c96a2b076e4c0af0fa8786b314e761633b782b12895b7253e
MD5 cebbbc98e914b1ac1522638c2da9133d
BLAKE2b-256 dacd5e9f2438c00c5fbc7b65eae77468a0ebb19a43f5f4e3db537f3c8125d9a3

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