Skip to content

tensordev

JAX-based tensor algebra library for signatures, free developments, Volterra signatures and inner product-kernels thereof.

Get started API reference GitHub

  • Configurable cores


    One set of tensor operations for dense total-degree, bidegree, partially symmetrized and shear cores. Build a core with make_core, or install it as the default with set_default_core.

  • Signatures and free developments


    Truncated path signatures, with optional blocking through Chen's identity, and free developments of tensor-valued paths.

  • Volterra and state-space signatures


    Volterra signatures for fractional, gamma and finite state-space kernels. State-space signatures carry a hidden state for streaming evaluation.

  • Signature kernels


    Classical, free, higher-order and FSSK signature kernels share one API for kernel values, Gram matrices, MMD and scoring rules.

  • Built on JAX


    JIT-compiled cores, and device placement follows JAX. With the default execution policy, every development and kernel is differentiable with respect to the paths and the kernel matrices A and b. Other kernel parameters have limits: see Volterra signatures and Signature kernels.

  • Native CPU kernels, alpha GPU path


    Linux (x86_64, aarch64) and macOS Apple Silicon wheels include native CPU kernels for eligible partially symmetrized signatures. Wordwise execution on NVIDIA GPUs is alpha.

Requirements

tensordev requires Python 3.11+ and JAX 0.10.0–0.11.x.

Installation

pip install tensordev

Linux (x86_64/aarch64, glibc 2.28+) and macOS Apple Silicon wheels include native CPU kernels. Other platforms and source installations contain no native kernels and run the JAX implementation throughout; no C++ compiler is required. See the native build instructions to enable native kernels when installing from source.

For the latest development version:

pip install git+https://github.com/hagerpa/tensordev.git

Quick start

import jax
jax.config.update("jax_enable_x64", True)

import tensordev as td
from tensordev.util import random_trigonometric_polynomial_paths

X = random_trigonometric_polynomial_paths(batch=4, steps=32, dim=2, key=0)

sig = td.path_signature(X, trunc=4)
ip = td.tensor_inner_product(sig, sig)

print(td.tensor_to_flat(sig).shape)
print(ip.shape)

Continue with Tensor algebra, Signatures, Volterra signatures, State-space signatures, Signature kernels, Performance and Background.