Skip to main content

tednet: a framework of tensor decomposition network.

Project description

Python package Documentation Status PyPI - License PyPI


tednet is a toolkit for tensor decomposition networks. Tensor decomposition networks are neural networks whose layers are decomposed by tensor decomposition, including CANDECOMP/PARAFAC, Tucker2, Tensor Train, Tensor Ring and so on. For a convenience to do research on it, tednet provides excellent tools to deal with tensorial networks.

Now, tednet is easy to be installed by pip:

pip install tednet

More information could be found in Document.

Quick Start


There are some operations supported in tednet, and it is convinient to use them. First, import it:

import tednet as tdt

Create matrix whose diagonal elements are ones:

diag_matrix = tdt.eye(5, 5)

A way to transfer the Pytorch tensor into numpy array:

diag_matrix = tdt.to_numpy(diag_matrix)

Similarly, the numpy array can be taken into Pytorch tensor by:

diag_matrix = tdt.to_tensor(diag_matrix)
Tensor Decomposition Networks (Tensor Ring for Sample)

To use tensor ring decomposition models, simply calling the tensor ring module is enough.

import tednet.tnn.tensor_ring as tr

# Define a TR-LeNet5
model = tr.TRLeNet5(10, [6, 6, 6, 6])

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tednet-0.1.3.tar.gz (19.6 kB view hashes)

Uploaded source

Built Distribution

tednet-0.1.3-py3-none-any.whl (38.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page