Decoupling multivariate functions using tensor decompositions, in Jax.
Project description
Decoupling
Fast tensor decoupling in Jax.
This library is a collection of algorithms for decoupling multivariate functions using tensor decompositions.
from decoupling.algorithm import BasicDecoupling
from decoupling.utils import collect_information, function_error
def target(x): # define a simple polynomial
return jnp.array([x[0]**3 + x[1]**2 + x[0]*b, x[1]**3 + x[0]**2 + x[0]*b])
rank, N = 4, 30 # rank and number of samples
info = collect_information(target, N, key) # collect outputs and jacobians
decoupling = BasicDecoupling(rank, key=key).run(*info) # compute decoupling
errors = function_error(target, decoupling, info[0], key) # evaluate
This project was built using uv (https://docs.astral.sh/uv).
Installation
You can easily get decoupling from PyPI:
pip install decoupling
Otherwise, for a local installation:
git clone git@github.com:mrochk/decoupling.git
pip install decoupling
Methodology
Tensor decoupling algorithms are used to find a decoupled representation of a target multivariate function. This is illustrated below.
In fact, this representation is a 2-layer MLP, meaning that tensor decoupling could be used to compress or build neural networks.
You can read about the basic methodology in this paper: https://arxiv.org/abs/1410.4060.
The goal of this library is to be the reference implementation of tensor decoupling algorithms. Our goal is to keep the source code as simple as possible, while being fast by leveraging Jax's JIT compiler, and, later, GPUs.
The other important aspect is that it should be easy to design and add new algorithms, by leveraging already written and reusable code.
Algorithms Implemented
- Polynomial Tensor Decoupling
decoupling/algorithm/basic[Dreesen, Ishteva & Schoukens (2015)] - Constrained Polynomial TD
decoupling/algorithm/ctd_polynomial[Hollander, (2017)] - CMTF B-Spline Decoupling
decoupling/algorithm/cmtf_bspline[De Jonghe & Ishteva (2025)] - CMTF P-Spline Decoupling
decoupling/algorithm/cmtf_pspline
Testing
uv run -m unittest discover testing -v # or ./test.sh
Project details
Release history Release notifications | RSS feed
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 decoupling-0.0.2.tar.gz.
File metadata
- Download URL: decoupling-0.0.2.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"11","id":"bullseye","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3301e949319c2cc738fd2d150bdb23ce4833c67183e755170e91f8f7e6a6e57
|
|
| MD5 |
c6a51d9ff378769b451c6ad816da7663
|
|
| BLAKE2b-256 |
64da7865d4029880b3097a7d7ec0ddf4348526d158638d41b83540c0272643b7
|
File details
Details for the file decoupling-0.0.2-py3-none-any.whl.
File metadata
- Download URL: decoupling-0.0.2-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"11","id":"bullseye","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22b4a3883e0effc2b92959ef87fbb4728504b637f20d71a6d05487245ea58a7b
|
|
| MD5 |
eacda0e87171372970c7334a8d5a4c9c
|
|
| BLAKE2b-256 |
8d2abf7088595c5b491f23fc475c8c398a77c16c05796f41486668b1c08f1019
|