Tensor Network Kernel Machines (TNKM)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d01c94a860f20393ae86015e260b881f362c41e256d669737ce4a3c90f6e3732
|
|
| MD5 |
ad6b55724cb1cf3a5b07087350b7502b
|
|
| BLAKE2b-256 |
33fbd50159a5e2aab1417022edf69ecb022c91927926b92af5297b1cf3bb4f44
|
Provenance
The following attestation bundles were made for tnkm-0.1.0.tar.gz:
Publisher:
publish.yml on AlbMLpy/tnkm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tnkm-0.1.0.tar.gz -
Subject digest:
d01c94a860f20393ae86015e260b881f362c41e256d669737ce4a3c90f6e3732 - Sigstore transparency entry: 2371539260
- Sigstore integration time:
-
Permalink:
AlbMLpy/tnkm@8b254a952ef9409c57fc72724e980ae0089dc868 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AlbMLpy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b254a952ef9409c57fc72724e980ae0089dc868 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7426cf863d0995c6eba39aabcedcac74118ee342dbc2589c05d0f3cc6f79a0cb
|
|
| MD5 |
14ff809d918100d40872333eb92ff3ea
|
|
| BLAKE2b-256 |
5cb926369e8d6756440f21049fe46ff6fa8ae1314a7ed3fa1735e7ec7406cf33
|
Provenance
The following attestation bundles were made for tnkm-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on AlbMLpy/tnkm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tnkm-0.1.0-py3-none-any.whl -
Subject digest:
7426cf863d0995c6eba39aabcedcac74118ee342dbc2589c05d0f3cc6f79a0cb - Sigstore transparency entry: 2371539287
- Sigstore integration time:
-
Permalink:
AlbMLpy/tnkm@8b254a952ef9409c57fc72724e980ae0089dc868 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AlbMLpy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8b254a952ef9409c57fc72724e980ae0089dc868 -
Trigger Event:
release
-
Statement type: