Skip to main content
https://badge.fury.io/py/tensorly-torch.svg

TensorLy-Torch

TensorLy-Torch is a Python library for deep tensor networks that builds on top of TensorLy and PyTorch. It allows to easily leverage tensor methods in a deep learning setting and comes with all batteries included.

With TensorLy-Torch, you can easily:

  • Tensor Factorizations: decomposing, manipulating and initializing tensor decompositions can be tricky. We take care of it all, in a convenient, unified API.

  • Leverage structure in your data: with tensor layers, you can easily leverage the structure in your data, through Tensor Regression Layers, Factorized Convolutions, etc

  • Built-in tensor layers: all you have to do is import tensorly torch and include the layers we provide directly within your PyTorch models!

  • Tensor hooks: you can easily augment your architectures with our built-in Tensor Hooks. Robustify your network with Tensor Dropout and automatically select the rank end-to-end with L1 Regularization!

  • All the methods available: we are always adding more methods to make it easy to compare between the performance of various deep tensor based methods!

Deep Tensorized Learning

Tensor methods generalize matrix algebraic operations to higher-orders. Deep neural networks typically map between higher-order tensors. In fact, it is the ability of deep convolutional neural networks to preserve and leverage local structure that, along with large datasets and efficient hardware, made the current levels of performance possible. Tensor methods allow to further leverage and preserve that structure, for individual layers or whole networks.

./doc/_static/tensorly-torch-pyramid.png

TensorLy is a Python library that aims at making tensor learning simple and accessible. It provides a high-level API for tensor methods, including core tensor operations, tensor decomposition and regression. It has a flexible backend that allows running operations seamlessly using NumPy, PyTorch, TensorFlow, JAX, MXNet and CuPy.

TensorLy-Torch is a PyTorch only library that builds on top of TensorLy and provides out-of-the-box tensor layers.

Improve your neural networks with tensor methods

Tensor methods generalize matrix algebraic operations to higher-orders. Deep neural networks typically map between higher-order tensors. In fact, it is the ability of deep convolutional neural networks to preserve and leverage local structure that, along with large datasets and efficient hardware, made the current levels of performance possible. Tensor methods allow to further leverage and preserve that structure, for individual layers or whole networks.

In TensorLy-Torch, we provide convenient layers that do all the heavy lifting for you and provide the benefits tensor based layers wrapped in a nice, well documented and tested API.

For instance, convolution layers of any order (2D, 3D or more), can be efficiently parametrized using tensor decomposition. Using a CP decomposition results in a separable convolution and you can replace your original convolution with a series of small efficient ones:

./doc/_static/cp-conv.png

These can be easily perform with FactorizedConv in TensorLy-Torch. We also have Tucker convolutions and new tensor-train convolutions! We also implement various other methods such as tensor regression and contraction layers, tensorized linear layers, tensor dropout and more!

Installing TensorLy-Torch

Through pip

pip install tensorly-torch

From source

git clone https://github.com/tensorly/torch
cd torch
pip install -e .

Metadata

Release files for tensorly-torch 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tensorly-torch 0.5.0
File Size Uploaded
tensorly-torch-0.5.0.tar.gz 43.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tensorly-torch 0.5.0
File Interpreter ABI Platform
tensorly_torch-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 102.6 kB

Release files / tensorly-torch-0.5.0.tar.gz

Download URL tensorly-torch-0.5.0.tar.gz
Size 43.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4c2f19f361113ca78f09b504a786075b0f51425468ae997a5f8018d4be6a4db5
BLAKE2b-256 checksum
How to use checksums
d624afea0adc5c29ae40d28bc359eaf888a1605699fbba690e76ec67c51b055a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release files / tensorly_torch-0.5.0-py3-none-any.whl

Download URL tensorly_torch-0.5.0-py3-none-any.whl
Size 59.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a14cab43bb82892e58940fb75e5c55ec1a550d9063fb722469f93cba449940b
BLAKE2b-256 checksum
How to use checksums
fb352da451f342ee532bf66507c89ff3cdefc0dfbacff83a2f088811deb2df17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page