API reference¶
tltorch
: Tensorized Deep Neural Networks
Factorized Tensors¶
TensorLyTorch builds on top of TensorLy and provides out of the box PyTorch layers for tensor based operations. The core of this is the concept of factorized tensors, which factorize our layers, instead of regular, dense PyTorch tensors.
You can create any factorized tensor through the main class, or directly create a specific subclass:

Tensor Factorization 

CP Factorization 

Tucker Factorization 

TensorTrain (MatrixProductState) Factorization 
Tensorized Matrices¶
In TensorLyTorch , you can also represent matrices in tensorized form, as lowrank tensors .

Tensor representing one or a batch of tensorized vectors/matrices/tensors 

Tensorized Matrix in CP Form 

Tensorized Matrix in Tucker Form 

Tensorized Matrix in the TensorTrain Matrix (MPO) Form 
Initialization¶
Module for initializing tensor decompositions

Initializes directly the parameters of a factorized tensor so the reconstruction has the specified standard deviation and 0 mean 

Initializes directly the weights and factors of a CP decomposition so the reconstruction has the specified std and 0 mean 

Initializes directly the weights and factors of a Tucker decomposition so the reconstruction has the specified std and 0 mean 

Initializes directly the weights and factors of a TT decomposition so the reconstruction has the specified std and 0 mean 
Tensor Contraction Layers¶

Tensor Contraction Layer [R4c5b935264591] 
Factorized Linear Layers¶

Tensorized FullyConnected Layers 
Factorized Convolutions¶
General NDimensional convolutions in Factorized forms

Create a factorized convolution of arbitrary order 
Tensor Dropout¶
These functions allow you to easily add or remove tensor dropout from tensor layers.

Tensor Dropout 

Removes the tensor dropout from a TensorModule 
You can also use the class API below but unless you have a particular use for the classes, you should use the convenient functions provided instead.

Decomposition Hook for Tensor Dropout on FactorizedTensor 
L1 Regularization¶
L1 Regularization on tensor modules.

Generalized Tensor Lasso from a factorized tensors 

Removes the tensor lasso from a TensorModule 