Skip to main content

TNKM logo

Tensor Network Kernel Machines (TNKM)

Documentation Test

TNKM is a JAX-based library for machine learning with tensor-network parameterizations.

It combines kernel methods with low-rank tensor decompositions to build scalable models with explicit rank control.

TNKM is intended for research in machine learning, system identification, and time-series modeling.

Features

  • CP and TT tensor-network kernel machines
  • Polynomial, Fourier, B-spline and other feature maps
  • Alternating Least Squares (ALS) and gradient-based optimization (Optax)
  • Explicit rank control for balancing model complexity and expressiveness
  • JAX-native implementation with JIT compilation and hardware acceleration

Installation

From PyPI

pip install tnkm

From source

git clone https://github.com/AlbMLpy/tnkm.git
cd tnkm
pip install .

Quick example

Fit a CP-based tensor-network kernel machine with polynomial features:

import jax.numpy as jnp

from tnkm.models import CPKM
from tnkm.optim import train_als
from tnkm.features import ProductFeatures, PolyFeature

d_dim = 2
x = jnp.ones((32, d_dim))
y = jnp.ones((32,))

features = ProductFeatures((PolyFeature(4, k_col=i) for i in range(d_dim)))
model = CPKM(features, rank=2, seed=0)

train_als(model, x, y, n_epoch=3, gamma_w=1e-3, beta_e=1.0)
y_pred = model.predict(x)

Documentation

Available at https://albmlpy.github.io/tnkm.

Contributing

Contributions to tnkm are welcome. If you would like to report issues, suggest improvements, or contribute code, please see CONTRIBUTING.md for development guidelines, installation instructions, and information about the contribution workflow.

Citation

TNKM is an open-source research software project. If you use TNKM in academic work, please cite the specific software version used. Citation information will be updated when a DOI or publication becomes available.

(Also consider starring the project on GitHub)

License

MIT License

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tnkm-0.1.0.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

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

tnkm-0.1.0-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tnkm-0.1.0.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tnkm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d01c94a860f20393ae86015e260b881f362c41e256d669737ce4a3c90f6e3732
MD5 ad6b55724cb1cf3a5b07087350b7502b
BLAKE2b-256 33fbd50159a5e2aab1417022edf69ecb022c91927926b92af5297b1cf3bb4f44

See more details on using hashes here.

Provenance

The following attestation bundles were made for tnkm-0.1.0.tar.gz:

Publisher: publish.yml on AlbMLpy/tnkm

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

File details

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

File metadata

  • Download URL: tnkm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tnkm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7426cf863d0995c6eba39aabcedcac74118ee342dbc2589c05d0f3cc6f79a0cb
MD5 14ff809d918100d40872333eb92ff3ea
BLAKE2b-256 5cb926369e8d6756440f21049fe46ff6fa8ae1314a7ed3fa1735e7ec7406cf33

See more details on using hashes here.

Provenance

The following attestation bundles were made for tnkm-0.1.0-py3-none-any.whl:

Publisher: publish.yml on AlbMLpy/tnkm

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