Skip to main content

Vikshep โ€” Vectorized Invariant Kernels for Scattering & High-performance Extraction Pipelines. A Zero-Copy C++/CUDA Wavelet Scattering Transform engine.

Project description

Vikshep: High-Performance Wavelet Scattering Primitives

Vectorized Invariant Kernels for Scattering & High-performance Extraction Pipelines

License: Apache 2.0 License: Commercial Python 3.10+ CUDA 11.8+

๐Ÿ”ฌ Overview & Mathematical Foundation

Vikshep is a high-performance, domain-agnostic mathematical engine for computing the Wavelet Scattering Transform (WST) of non-stationary 1-D time-series data. It is engineered to extract robust structural features from environments with extreme noise floors (e.g., high-frequency trading tick data, gravitational wave interferometry, and high-density EEG arrays).

Traditional Fourier analysis fails on non-stationary transients due to a fundamental lack of temporal localization. Vikshep solves this by implementing a deep, non-linear cascaded filter bank.

The Scattering Cascade

The WST constructs a translation-invariant signal representation through an iterative process of wavelet convolutions and complex modulus non-linearities:

  1. Zeroth-Order (Local Average): $$S_0 x(t) = x * \phi(t)$$ A simple low-pass filter $\phi(t)$ that extracts the invariant baseline.

  2. First-Order (Scalogram Envelope): $$S_1 x(t, \lambda_1) = |x * \psi_{\lambda_1}| * \phi(t)$$ The signal $x(t)$ is convolved with an analytic Morlet wavelet $\psi_{\lambda_1}$ at center frequency $\lambda_1$. The complex modulus $| \cdot |$ acts as a non-linearity (demodulation), extracting the instantaneous amplitude envelope. Finally, it is smoothed by $\phi(t)$. This captures the energy present in the frequency band $\lambda_1$.

  3. Second-Order (Transient Modulation): $$S_2 x(t, \lambda_1, \lambda_2) = ||x * \psi_{\lambda_1}| * \psi_{\lambda_2}| * \phi(t)$$ The envelope from the first stage is convolved again with a lower-frequency wavelet $\psi_{\lambda_2}$, capturing transient cross-frequency modulations (e.g., amplitude bursts occurring within specific carrier frequency bands).

Lipschitz Stability & Deformation Invariance

Because the Morlet filter bank is carefully constructed such that the peak $\ell_1$ norm of the wavelets satisfies $|\psi_{\lambda}|_1 \le 0.98$, the transform is provably contractive.

The Lipschitz constant of the cascade is strictly bounded: $$|Sx - Sy|_2 ;\leq; (0.98)^m \cdot |x - y|_2$$

where $m$ is the scattering depth. This mathematical guarantee ensures that the feature representation is stable against adversarial noise perturbations and time-warping deformationsโ€”essential properties for downstream Transformer or AI agent ingestion.


โšก The Engine Architecture

Vikshep ships a Zero-Copy C++/CUDA kernel for extreme high-throughput processing, alongside a mathematically rigorous CPU fallback built on a Radix-2 Cooley-Tukey FFT with unitary normalization.

Absolute design constraints: There are zero mocks. There are no hardcoded scalograms. Every execution path performs the true mathematical transform.

Detailed Directory Structure

open-source-wst/
โ”œโ”€โ”€ CMakeLists.txt                 โ† CMake build configuration (detects CUDA, falls back to CPU)
โ”œโ”€โ”€ pyproject.toml                 โ† PEP 621 package metadata & scikit-build-core config
โ”‚
โ”œโ”€โ”€ cpp/                           โ† C++/CUDA High-Performance Engine
โ”‚   โ”œโ”€โ”€ wst_kernel.cuh             โ† GPU templates: WSTEngine<HopperTag, J, Q> 
โ”‚   โ”œโ”€โ”€ jtfs_kernel.cuh            โ† GPU Joint Time-Frequency Scattering kernels
โ”‚   โ”œโ”€โ”€ cpu_wst_engine.h           โ† CPU fallback: Radix-2 FFT Morlet scattering cascade
โ”‚   โ”œโ”€โ”€ memory_staging.cuh/cu      โ† Zero-copy Arrow/Numpy buffer management
โ”‚   โ”œโ”€โ”€ wst_bindings.cu            โ† pybind11 Python extension bridging
โ”‚   โ””โ”€โ”€ wst_bridge.h/cu            โ† Shared library FFI for Rust enterprise orchestrator
โ”‚
โ””โ”€โ”€ src/vikshep/                   โ† Python API & Agentic Protocols
    โ”œโ”€โ”€ __init__.py                
    โ”œโ”€โ”€ core.py                    โ† `NativeWSTExtractor` & `WaveletScatteringExtractor`
    โ”œโ”€โ”€ mcp_server.py              โ† Model Context Protocol (FastMCP) tool definitions
    โ”œโ”€โ”€ reduction.py               โ† `PCAReducer` for manifold dimension reduction
    โ”œโ”€โ”€ foundation.py              โ† Time-Frequency Consistency (TF-C) PyTorch stub
    โ”œโ”€โ”€ io.py                      โ† .npy tensor I/O
    โ””โ”€โ”€ utils.py                   โ† SNR & anomaly threshold heuristics

๐Ÿš€ Installation & Usage

1. PyPI Install (Standard)

pip install vikshep

Note: The PyPI wheel will automatically detect if NVIDIA CUDA libraries are available and enable GPU acceleration. Otherwise, it compiles the CPU-only Radix-2 FFT backend.

2. From Source

git clone https://github.com/samvardhan03/Viskshep.git
cd Viskshep/open-source-wst
pip install -e ".[dev]"

Quick Start Example

import numpy as np
from vikshep import NativeWSTExtractor, PCAReducer

# 1. Initialize the C++/CUDA Engine (J=8 scales, Q=16 wavelets/octave)
engine = NativeWSTExtractor(J=8, Q=16, depth=2)

# 2. Ingest raw non-stationary signal (e.g., noisy EEG or Tick Data)
signal = np.random.randn(4096).astype(np.float32)

# 3. Compute the Wavelet Scattering Fingerprint
coefficients = engine.fingerprint(signal)
print(f"Scattering Paths Shape: {coefficients.shape}")

# 4. Reduce dimensionality for Transformer ingestion (retain 95% variance)
reducer = PCAReducer(variance_threshold=0.95)
# Note: In practice, provide a batch tensor (B, P, T) to fit_transform

๐Ÿค– Model Context Protocol (MCP)

Vikshep functions as an autonomous tool for Agentic AI workflows via the Model Context Protocol.

Start the stdio transport server:

vikshep-server

This exposes the execute_wst tool to orchestrators (like LangChain or custom Bun backends), allowing the AI to autonomously ingest .npy directories, configure hyper-parameters $(J, Q)$, compute WSTs, apply PCA reduction, and receive structured JSON metadata (SNR, null counts, variance anomalies) to gate data quality.


โš–๏ธ Dual Licensing Model

Vikshep operates under a dual-licensing framework to support both open scientific research and highly-scaled proprietary enterprise integrations.

  1. Open Source Research Tier (Apache 2.0)

    • Includes the core Python API, the full C++/CUDA math engine (wst_kernel.cuh, cpu_wst_engine.h), and the Model Context Protocol (MCP) server.
    • Ideal for independent researchers, academic labs, and open-source applications.
    • License: See LICENSE for Apache 2.0 details.
  2. OmniPulse Enterprise / Commercial License

    • OmniPulse is our proprietary enterprise SaaS tier that utilizes Vikshep as its mathematical backend.
    • OmniPulse deployments include high-throughput Rust-based orchestration clusters, Zero-Copy Arrow Plasma memory fabrics, cryptographic IPFS licensing, HNSW vector database integrations, and proprietary data ingestion pipelines (e.g., FIX protocols for HFT).
    • Contact: For laboratory exascale deployments, clinical pipelines, or enterprise commercial integration, please contact shekhawatsamvardhan@gmail.com.

Part of the Viskshep monorepo.

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

vikshep-0.2.0.tar.gz (38.8 kB view details)

Uploaded Source

Built Distributions

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

vikshep-0.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

vikshep-0.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (127.9 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

vikshep-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

vikshep-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (126.0 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

vikshep-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

vikshep-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (125.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

vikshep-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

vikshep-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (125.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

vikshep-0.2.0-cp311-cp311-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

vikshep-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (125.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

vikshep-0.2.0-cp311-cp311-macosx_10_16_x86_64.whl (111.0 kB view details)

Uploaded CPython 3.11macOS 10.16+ x86-64

vikshep-0.2.0-cp310-cp310-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

vikshep-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (124.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file vikshep-0.2.0.tar.gz.

File metadata

  • Download URL: vikshep-0.2.0.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for vikshep-0.2.0.tar.gz
Algorithm Hash digest
SHA256 862aef6a75fd8d25d8f96eadf955611ebb210ef2b12c9a4462fbc4b8c228b593
MD5 615500e11eca82beeb3493e6237fb753
BLAKE2b-256 fb611880efca5bc428ce6f8c9ae8b7b1dcb1d42dea1231f6ddae0556614fc719

See more details on using hashes here.

File details

Details for the file vikshep-0.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6d8f018b9c7b60f8dfc99f4d44329cfaed58c76c8a5acfbf6b5bb9e2fe72563c
MD5 466281d39c770c5a6f4ffcc24fe2b4c2
BLAKE2b-256 bbf0b3624d78fd091c172bfb0d230f95b4a922eeb8066c3f2c09792fbf62af36

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vikshep-0.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 947bdf543e768719c10b3734f509df446e27bf7f1dbb2b300177c5e927cb50bc
MD5 06419f04294302ccc0f02da2042dc15d
BLAKE2b-256 393acd46736929650353472ea01f67141f9f5a89d89866dafd47d6e9b548bdc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vikshep-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6e7251bacef27dbb772cda2959ed179f24c3669ec30c40e0f75e0925d3750011
MD5 3506db943a255e24ca0593d58f354462
BLAKE2b-256 59c0e14228fd626380968dbf98a5b2f363868e8e58075cec6dfb8f93d876276f

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vikshep-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7dda739e31d8d004d08fb45cdf5782f585229be1789a922a10c8b64ba2a53aad
MD5 677f434a5d319a8741598a7200b9958a
BLAKE2b-256 b1463d0a47c61e58d207a4d7c3f406a1a20d26988c61746a3d3c15c884241995

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vikshep-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1ae26fe24349bab3a277fae04bca98e72ff48218b5e988d4d3c712a2109fe408
MD5 f85c22844602dde72ba186684ce7c86b
BLAKE2b-256 57e7dcdf9ed52a7795274de7eeded7c5f42b70ab2dae4c5b731c2517dbc6a304

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vikshep-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a9cc51d8ed7b955c1a33eaa755e5a04f1c52980a92b248d1c0788fbfec63e8e3
MD5 715e4239df9d83b7eaac723aa5403847
BLAKE2b-256 04e799bc8e4a137e08258d84a2713ab1e10c15c81fa99fd4984d1ef09551b43a

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vikshep-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ed5a358821a116725390bc6ab9d329242c8d168d9b95623f813b1538e5ba4c6d
MD5 bbd9fe46c26a96e3d06d6c63fe0e1cac
BLAKE2b-256 29c77f8c42bd0aa45cf3dfa68622d27cc3e23c074f7ef2464a1ddbe04ebecff6

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vikshep-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 236658534801b63d251dc476dbc694c437131e2735c7107153525973af9b29ac
MD5 565a1c8e114e82a5cfa942ca94ef6ac3
BLAKE2b-256 d9413ca57833cdf975432e8809a02383a40c53975d3683e7d190824de95b120e

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vikshep-0.2.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 82e47c0d6c8e3b4a9fa807c0a65852efeab0ff79fe3e3e4273734d689d86342d
MD5 a3a523cc1b8d8050bb953588c18d494b
BLAKE2b-256 be104d9363df118e5c827882128bc2c498337a48a4c16d8faffc3979103e39d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vikshep-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0b0a98ae709f4097dca518ec34efcba01fde323817a89037d3c7758e076c3642
MD5 7df94971198cdb879f1b3af67eb8d542
BLAKE2b-256 e73dd90b4f88df2c0a6fa1807c8416e13efb74591be6ae3237767dd1a94e66dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vikshep-0.2.0-cp311-cp311-macosx_10_16_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp311-cp311-macosx_10_16_x86_64.whl
Algorithm Hash digest
SHA256 6270e86ca2675c037978f6a598ac0400e47725509aa9bf80db24b551b2a9e83b
MD5 38836ade73dde102cc28c72275bd4a8c
BLAKE2b-256 2e50aab59e80928606567a68b2aa5e65030f9b2bcd6b2e698f9ffe426e2ddf65

See more details on using hashes here.

File details

Details for the file vikshep-0.2.0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 805e8e9ee5cc0b7fc671b6438a2529677f33903df34a8f5ccb6d207467a98287
MD5 28a5c52cdbeff5a5aecb5dabcd178e6b
BLAKE2b-256 c30041ecdc150ee3ed43ceb71d8dc980e457e6692131f7c779dee0dfae81e8ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp310-cp310-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vikshep-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vikshep-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dac3a5fd70da9e937836153132dc56d7f416af9f6d88a76410890bc10b826fd0
MD5 3361b63ee0c0db387bf4dd25bb42853c
BLAKE2b-256 3859cd35f17bcf6cff2685f165dd1400b7de9518c1c80868f04c6041dac9b84d

See more details on using hashes here.

Provenance

The following attestation bundles were made for vikshep-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on samvardhan03/Vikshep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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