Skip to main content

Decoupling multivariate functions using tensor decompositions, in Jax.

Project description

Logo

Untangle

Fast tensor decoupling in Jax. Collection of algorithms for decoupling multivariate functions using tensor decompositions.

from untangle.algorithm import BasicDecoupling
from untangle.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 numeber 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 untangle from PyPI:

pip install decoupling # ("untangle" was already taken...)

Otherwise, for a local installation:

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

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 untangle/algorithm/basic [Dreesen, Ishteva & Schoukens (2015)]
  • Constrained Polynomial TD untangle/algorithm/ctd_polynomial [Hollander, (2017)]
  • CMTF B-Spline Decoupling untangle/algorithm/cmtf_bspline [De Jonghe & Ishteva (2025)]
  • CMTF P-Spline Decoupling untangle/algorithm/cmtf_pspline

Testing

uv run -m unittest discover testing -v # or ./test.sh

Project details


Download files

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

Source Distribution

decoupling-0.0.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

decoupling-0.0.1-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file decoupling-0.0.1.tar.gz.

File metadata

  • Download URL: decoupling-0.0.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for decoupling-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d804deac4888a9cfe025ba19559dea0c921f14b36a5430de6bbc1507b4d16ef1
MD5 05d04f7c4515d967bc43241a9e9b1a63
BLAKE2b-256 0c263d869464f1cdfc5ef4f6013adc6ed98e8e6b3393fdd600bfa93f310d839a

See more details on using hashes here.

File details

Details for the file decoupling-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: decoupling-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for decoupling-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9d714180fd7c7aa5f3dc5540667d799867e44c4c69101b6185201717c7ecd0f
MD5 7068211b64d3cf00b4125f303c63e045
BLAKE2b-256 d44d4d575d6a35488845c5d1073e3f285ee3c6be6d236213c39fb450fd1d08fa

See more details on using hashes here.

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