Skip to content

About

Fast tensor-based decoupling in Jax.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

152 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Decoupling: Fast tensor-based decoupling in Jax

Tensor decoupling is a methodology for decoupling multivariate functions using tensor decompositions.

This library aims to be the reference implementation of tensor decoupling algorithms.

Usage

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 

Installation

You can easily get decoupling from PyPI:

pip install decoupling

Otherwise to install from source:

git clone git@github.com:mrochk/decoupling.git
pip install decoupling

Methodology

Tensor 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.

Context

The development of this library was started in the context of my master's thesis.

Papers

Decoupling has been used for the experiments of the following papers:

Citing Decoupling

@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},
}

About

Fast tensor-based decoupling in Jax.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages