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 the values of the constructed low-rank tensor approximation, as well as a number of auxiliary useful utilities.
In the current implementation, this software product actually almost duplicates the functionality related to the rectcross
algoritm of the popular ttpy python package.
However, this compact implementation does not require a fortran compiler to be installed.
The repository also contains a rough implementation of the jax-based version of the code. Upon completion of development, the corresponding release will be made with the addition of the necessary documentation. See the colab notebooks teneva_code and teneva_code_jax with related code and examples.
Requirements
- Python programming language (version >= 3.7).
- "Standard" python packages numpy and scipy (all of them are included in anaconda distribution).
- Python package numba.
With this package, the tensor values at the given points will be calculated an order of magnitude faster.
Installation
- 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.
- Install numba python package according to instructions from the corresponding repository.
- Download this repository and run
python setup.py install
from the root folder of the project.You can also install this package via pip:
pip install teneva
. - To uninstall this package from the system run
pip uninstall teneva
.
Examples
- See the colab notebook teneva_demo with examples.
Tests
- See the colab notebook teneva_test, where the comparison with the package
ttpy
is provided. - See the folder
test
with unit tests. Call it aspython -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.