Tensor decoupling is a methodology for decoupling multivariate functions using tensor decompositions.
This library aims to be the reference implementation of tensor decoupling algorithms.
import jax, jax.numpy as jnp
from decoupling import Algorithm, utils
def target(x): # define a simple polynomial
return jnp.array([
x[0]**3 + x[1]**2 + x[0]*x[1],
x[1]**3 + x[0]**2 + x[0]*x[1],
])
key = jax.random.key(0)
rank = 4
# collect information (inputs, outputs, jacobians)
samples = utils.collect_samples_from_random(key, target, ninputs=2, N=100)
decoupling = Algorithm(rank, key).fit(samples) # compute decoupling
e1, e2 = utils.function_error_from_callable(target, decoupling, samples.inputs)
print(f'Errors: e1={e1:.2f}, e2={e2:.2f}') # compare to target
# Errors: e1=1.20, e2=1.29 You can easily get decoupling from PyPI:
pip install decouplingOtherwise to install from source:
git clone git@github.com:mrochk/decoupling.git
pip install decouplingTensor decoupling algorithms are used to find decoupled representations of target multivariate functions. This is illustrated below.
This decoupled representation is a one-hidden-layer MLP, meaning that tensor decoupling approaches can be used to compress or build neural networks.
You can read more about the basic methodology in this paper.
Our goal is to keep the source code as simple as possible, while being very fast by leveraging Jax's JIT compiler.
The development of this library was started in the context of my master's thesis.
Decoupling has been used for the experiments of the following papers:
- Making Tensor Decoupling More Robust and Less Parametric (https://arxiv.org/abs/2610.16937)
- Warm Starting Neural Dynamics Models From Few Jacobian Samples (https://arxiv.org/abs/2611.21465)
@software{decoupling2026github,
author = {Maxime Rochkoulets},
title = {Decoupling: Fast tensor-based decoupling in {JAX}.},
url = {http://github.com/mrochk/decoupling},
version = {0.0.9},
year = {2026},
}

