Skip to main content

GPU-accelerated Sample Entropy in Python

Project description

GPU-Accelerated Sample Entropy in Python

This repository provides a fast, GPU-accelerated implementation of Sample Entropy (SampEn) for time series analysis using Python, Numba, and CUDA.

Sample Entropy is a widely-used statistical measure that quantifies the complexity or regularity of a time series. This implementation leverages GPU parallelism to efficiently compute SampEn for large datasets. It has been benchmarked as 100x faster than CPU-based implementations.

Features

  • Efficient GPU-based kernel using Numba CUDA
  • Chebyshev distance for sequence similarity
  • Dynamic chunk processing to handle large time series
  • Graceful handling of edge cases (zero matches, infinite entropy)

Requirements

  • Python 3.8+
  • NumPy
  • Numba
  • CUDA-enabled GPU and NVIDIA drivers

Install dependencies via:

git clone https://github.com/4d30/sampen.git
cd sampen
pip install -e .

Usage

from sampen import sampen
import numpy as np

data = np.random.rand(10000)  # your time series data
m = 2                         # template length
r = 0.2                       # similarity threshold

entropy = sampen_gpu(data, m, r)
print("Sample Entropy:", entropy)

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

sampen_gpu-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

sampen_gpu-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file sampen_gpu-0.1.0.tar.gz.

File metadata

  • Download URL: sampen_gpu-0.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for sampen_gpu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bb40ca33124861a6ccb090cb2b80304da16b2e17f2ca41043301fd4a45fa0517
MD5 e965d43d3029fa00790fc87e997ece4e
BLAKE2b-256 90c57eca618121690cbc4bfe3853bb5264a51dcebabb9f66d3b7dfe95b35bc11

See more details on using hashes here.

File details

Details for the file sampen_gpu-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sampen_gpu-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for sampen_gpu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3b4b62e655744fb5dd146d1d7a9bd90a3a601fcf4dbff74971bab948a0c71a7
MD5 10279b07ffc6b25555499fdd506dc27a
BLAKE2b-256 a62a972d7fa2c830496764bdeaf5f954a87ea16433618943d7effa8ee100bd64

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