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.4.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.4-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gpuicalcc-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 1dfa0d580711e00a89765053ad58b11ffa7b51a14646ba7794ae5d80689f002b
MD5 e9135c32cc857005fc27ae2b2b6f416a
BLAKE2b-256 403d6d2f67244cee545a358404bb99ff02f566ed3d46cb4cb45d0f16b56d2d49

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gpuicalcc-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e9fb45bc8120109b6b4e561ab25f325c5ac30a5f2e34fea2671e810833e7e84d
MD5 ea165a1ec665e356e9bba215e7ab3021
BLAKE2b-256 63d19c5c1bd81a39c6842efe137463468887260a967b11bdecc051a122131a91

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