| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
ttrecipes is a Python library for working with, visualizing and understanding tensors (multiway arrays) compressed using the tensor train format. We make heavy use of many key possibilities offered by the TT model (many are provided by the great ttpy toolbox):
Example of surrogate modeling interactive navigation (a gradient boosting regressor trained on the UCI Airfoil Self-Noise Data Set, converted to the TT format via cross-approximation):
Sobol-based sensitivity analysis of a 10-dimensional fire-spread model (~10 seconds were needed to compute these and more higher-order indices):
See the examples/ folder for some sample scripts. Check out this Jupyter Notebook for the examples used in our paper Tensor Approximation of Advanced Metrics for Sensitivity Analysis. You can also run and interact with the notebook online using Binder
ttrecipes depends on ttpy and other common scientific computation packages (SciPy, NumPy, etc). The provided environment.yml, requirements.txt and ttpy_repo.txt files collect these dependencies for an easy installation using conda or pip respectively. As usual, it is recommended to create a new Python environment for the project.
If you use conda, you can create an environment (called ttrecipes by default) with the required dependencies already installed with the following command:
conda env create --file environment.yml
Or, if you prefer, you can also use pip to install the required packages:
pip install -r requirements.txt
Do not forget to activate the newly created environment with 'conda activate' or 'source activate'.
ttpy needs to be explicitly installed after the basic dependencies. To install a version compatible with ttrecipes, run the following pip command:
pip install -r ttpy_repo.txt
Important: due to a bug in some releases of the gfortran compiler in versions 5.0-8.0, the installation of ttpy may fail (issue #60). If this is your case, try to use a different gfortran version (e.g. gfortran-4.8) or a different compiler (e.g. ifort).
Once the dependencies are ready, install ttrecipes by cloning this repository and running 'pip install' with the current version in editable mode:
git clone https://github.com/rballester/ttrecipes.git cd ttrecipes pip install -e .
import ttrecipes as tr tr.core.anyfunction()
For instance, use the following to visualize a TT tensor (tt.vector object from ttpy):
import ttrecipes.mpl tr.mpl.navigation(t)
This work was partially supported by the UZH Forschungskredit "Candoc", grant number FK-16-012.
| Back | FazBrowse Home | New Git URL |