Skip to main content

Fast multidimensional cross approximation in the tensor-train (TT) format.

Project description

teneva

Description

This python package, named teneva (tensor evaluation), provides very compact implementation for the multidimensional cross approximation algorithm in the tensor-train (TT) format. This package also contains a function for quickly calculating (using numba package) the values of the constructed low-rank tensor approximation, as well as a number of auxiliary useful utilities for rounding, adding, multiplying TT-tensors, etc.

Note that:

  1. This compact implementation does not require a fortran compiler to be installed, unlike the original ttpy python package.
  2. The program code is organized within a functional paradigm. Most functions take Y - a list of the TT-cores (3D numpy arrays) - as an input argument and return its updated representation as a new list of TT-cores or some related scalar values (mean, norm, etc.).
  3. The simple form of the code presented in this repository allows in the future to rewrite it using popular jax framework.

Requirements

  1. Python programming language (version >= 3.6).
  2. "Standard" python packages numpy and scipy (all of them are included in anaconda distribution).
  3. Python package numba.

    With this package, the tensor values at the given points will be calculated an order of magnitude faster.

All of these dependencies must be manually installed prior to installing this package.

Installation

  1. Install python (version >= 3.7) and "standard" python packages listed in the section Requirements above. The best way is to install only anaconda distribution which includes all the packages.
  2. Install numba python package according to instructions from the corresponding repository.
  3. Install this package via pip: pip install teneva.

    You can also download the repository teneva and run python setup.py install from the root folder of the project.

  4. To uninstall this package from the system run pip uninstall teneva.

Examples

  • See the jupyter notebook example.ipynb in the repository, which contains various useful examples.
  • See the colab notebook teneva_demo with the basic example.

Tests

  • See the folder test with detailed unit tests. Call it as
    python -m unittest test_base test_vs_ttpy
    

    To run the test test_vs_ttpy, you should first install the ttpy python package.

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

teneva-0.6.1.tar.gz (14.5 kB view hashes)

Uploaded Source

Built Distribution

teneva-0.6.1-py3-none-any.whl (11.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page