{"id":26005175,"url":"https://github.com/ion-g-ion/torchtt","last_synced_at":"2025-04-06T13:08:58.822Z","repository":{"id":37427337,"uuid":"438317250","full_name":"ion-g-ion/torchTT","owner":"ion-g-ion","description":"Tensor-Train decomposition in pytorch","archived":false,"fork":false,"pushed_at":"2025-02-01T07:04:39.000Z","size":1031,"stargazers_count":60,"open_issues_count":3,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-06T13:08:43.467Z","etag":null,"topics":["python3","pytorch","tensor-decomposition","tensor-train"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ion-g-ion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-14T16:08:00.000Z","updated_at":"2025-03-08T05:46:08.000Z","dependencies_parsed_at":"2024-07-09T23:31:07.831Z","dependency_job_id":"e2d7db6a-3212-4336-8fda-c875fb830c7d","html_url":"https://github.com/ion-g-ion/torchTT","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ion-g-ion%2FtorchTT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ion-g-ion%2FtorchTT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ion-g-ion%2FtorchTT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ion-g-ion%2FtorchTT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ion-g-ion","download_url":"https://codeload.github.com/ion-g-ion/torchTT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485287,"owners_count":20946398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python3","pytorch","tensor-decomposition","tensor-train"],"created_at":"2025-03-05T20:41:14.460Z","updated_at":"2025-04-06T13:08:58.786Z","avatar_url":"https://github.com/ion-g-ion.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/ion-g-ion/torchTT/blob/main/logo.png?raw=true\" width=\"400px\" \u003e\n\u003c/p\u003e\n\n# torchTT\nTensor-Train decomposition in `pytorch`\n\nTensor-Train decomposition package written in Python on top of `pytorch`. Supports GPU acceleration and automatic differentiation.\nIt also contains routines for solving linear systems in the TT format and performing adaptive cross approximation  (the AMEN solver/cross interpolation is inspired form the [MATLAB TT-Toolbox](https://github.com/oseledets/TT-Toolbox)).\nSome routines are implemented in C++ for an increased execution speed.\n\n\n## Installation\n\n### Requirements\nFollowing requirements are needed:\n\n- `python\u003e=3.8`\n- `torch\u003e=1.7.0`\n- `numpy\u003e=1.18`\n- [`opt_einsum`](https://pypi.org/project/opt-einsum/)\n\nThe GPU (if available) version of pytorch is recommended to be installed. Read the [official installation guide](https://pytorch.org/get-started/locally/) for further info.\n\n### Using pip\nYou can install the package using the `pip` command:\n\n```\npip install torchTT\n```\n\nThe latest github version can be installed using:\n\n```\npip install git+https://github.com/ion-g-ion/torchTT\n```\n\nOne can also clone the repository and manually install the package: \n\n```\ngit clone https://github.com/ion-g-ion/torchTT\ncd torchTT\npython setup.py install\n``` \n\n### Using conda\n\n**TODO**\n\n## Components\n\nThe main modules/submodules that can be accessed after importing `torchtt` are briefly desctibed in the following table.\nDetailed description can be found [here](https://ion-g-ion.github.io/torchTT/index.html).\n\n| Component | Description |\n| --- | --- |\n| [`torchtt`](https://ion-g-ion.github.io/torchTT/torchtt/torchtt.html)             | Basic TT class and basic linear algebra functions. |\n| [`torchtt.solvers`](https://ion-g-ion.github.io/torchTT/torchtt/solvers.html)     | Implementation of the AMEN solver. |\n| [`torchtt.grad`](https://ion-g-ion.github.io/torchTT/torchtt/grad.html)        | Wrapper for automatic differentiation. |\n| [`torchtt.manifold`](https://ion-g-ion.github.io/torchTT/torchtt/manifold.html)    | Riemannian gradient and projection onto manifolds of tensors with fixed TT rank. |\n| [`torchtt.nn`](https://ion-g-ion.github.io/torchTT/torchtt/nn.html)          | Basic TT neural network layer. |\n| [`torchtt.interpolate`](https://ion-g-ion.github.io/torchTT/torchtt/interpolate.html) | Cross approximation routines. |\n\n## Tests \n\nThe directory [tests/](tests/) from the root folder contains all the `unittests`. To run them use the command:\n\n```\npytest tests/\n```\n\n\n## Documentation and examples\nThe documentation can be found [here](https://ion-g-ion.github.io/torchTT/index.html).\nFollowing example scripts (as well as python notebooks) are also provied provided as part of the documentation:\n\n * [basic_tutorial.py](examples/basic_tutorial.py) / [basic_tutorial.ipynp](examples/basic_tutorial.ipynb): This contains a basic tutorial on decomposing full tensors in the TT format as well as performing rank rounding, slicing ([Try on Google Colab](https://colab.research.google.com/github/ion-g-ion/torchTT/blob/main/examples/basic_tutorial.ipynb)). \n * [basic_linalg.py](examples/basic_linalg.py) / [basic_linalg.ipynp](examples/basic_linalg.ipynb): This tutorial presents all the algebra operations that can be performed in the TT format ([Try on Google Colab](https://colab.research.google.com/github/ion-g-ion/torchTT/blob/main/examples/basic_linalg.ipynb)). \n * [efficient_linalg.py](examples/efficient_linalg.py) / [efficient_linalg.ipynb](examples/efficient_linalg.ipynb): contains the DMRG for fast matves and AMEN for elementwise inversion in the TT format ([Try on Google Colab](https://colab.research.google.com/github/ion-g-ion/torchTT/blob/main/examples/efficient_linalg.ipynb)). \n * [automatic_differentiation.py](examples/automatic_differentiation.py) / [automatic_differentiation.ipynp](examples/automatic_differentiation.ipynb): Basic tutorial on AD in `torchtt` ([Try on Google Colab](https://colab.research.google.com/github/ion-g-ion/torchTT/blob/main/examples/automatic_differentiation.ipynb)). \n * [cross_interpolation.py](examples/cross_interpolation.py) / [cross_interpolation.ipynb](examples/cross_interpolation.ipynb): In this script, the cross interpolation emthod is exemplified ([Try on Google Colab](https://colab.research.google.com/github/ion-g-ion/torchTT/blob/main/examples/cross_interpolation.ipynb)). \n * [system_solvers.py](examples/system_solvers.py) / [system_solvers.ipynb](examples/system_solvers.ipynb): This contains the bais ussage of the multilinear solvers ([Try on Google Colab](https://colab.research.google.com/github/ion-g-ion/torchTT/blob/main/examples/system_solvers.ipynb)). \n * [cuda.py](examples/cuda.py) / [cuda.ipynb](examples/cuda.ipynb): This provides an example on how to use the GPU acceleration ([Try on Google Colab](https://colab.research.google.com/github/ion-g-ion/torchTT/blob/main/examples/cuda.ipynb)). \n * [basic_nn.py](examples/basic_nn.py) / [basic_nn.ipynb](examples/basic_nn.ipynb): This provides an example on how to use the TT neural network layers ([Try on Google Colab](https://colab.research.google.com/github/ion-g-ion/torchTT/blob/main/examples/basic_nn.ipynb)). \n * [mnist_nn.py](examples/mnist_nn.py) / [mnist_nn.ipynb](examples/mnist_nn.ipynb): Example of TT layers used for image classification ([Try on Google Colab](https://colab.research.google.com/github/ion-g-ion/torchTT/blob/main/examples/mnist_nn.ipynb)). \n \n The documentation is generated using `shpinx` with:\n\n ```\n make html\n ```\n\n after installing the packages\n\n ```\n pip install sphinx sphinx_rtd_theme\n ```\n\n## Author \nIon Gabriel Ion, e-mail: ion.ion.gabriel@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fion-g-ion%2Ftorchtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fion-g-ion%2Ftorchtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fion-g-ion%2Ftorchtt/lists"}