Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tnbar/tednet
TedNet: A Pytorch Toolkit for Tensor Decomposition Networks
https://github.com/tnbar/tednet
artificial-intelligence deep-neural-networks pytorch tensor-decomposition
Last synced: 6 days ago
JSON representation
TedNet: A Pytorch Toolkit for Tensor Decomposition Networks
- Host: GitHub
- URL: https://github.com/tnbar/tednet
- Owner: tnbar
- License: mit
- Created: 2020-12-04T09:36:43.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-06T03:00:27.000Z (almost 3 years ago)
- Last Synced: 2025-01-18T09:11:36.885Z (15 days ago)
- Topics: artificial-intelligence, deep-neural-networks, pytorch, tensor-decomposition
- Language: Python
- Homepage:
- Size: 313 KB
- Stars: 91
- Watchers: 3
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Python package](https://github.com/tnbar/tednet/actions/workflows/python-package.yml/badge.svg)](https://github.com/tnbar/tednet/actions/workflows/python-package.yml)
[![Documentation Status](https://readthedocs.org/projects/tednet/badge/?version=latest)](https://tednet.readthedocs.io/en/latest/?badge=latest)
![PyPI - License](https://img.shields.io/pypi/l/tednet)
[![PyPI](https://img.shields.io/pypi/v/tednet)](https://pypi.org/project/tednet/)# TedNet: A Pytorch Toolkit for Tensor Decomposition Networks
`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`:
```shell script
pip install tednet
```More information could be found in [Document](https://tednet.readthedocs.io/en/latest/index.html).
---
### Quick Start
##### Operation
There are some operations supported in `tednet`, and it is convinient to use them. First, import it:```python
import tednet as tdt
```Create matrix whose diagonal elements are ones:
```python
diag_matrix = tdt.eye(5, 5)
```A way to transfer the Pytorch tensor into numpy array:
```python
diag_matrix = tdt.to_numpy(diag_matrix)
```Similarly, the numpy array can be taken into Pytorch tensor by:
```python
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.```python
import tednet.tnn.tensor_ring as tr# Define a TR-LeNet5
model = tr.TRLeNet5(10, [6, 6, 6, 6])
```---
### Citing
If you use `tednet` in an academic work, we will appreciate you for citing our paper with:
```bibtex
@article{DBLP:journals/ijon/PanWX22,
author = {Yu Pan and
Maolin Wang and
Zenglin Xu},
title = {TedNet: {A} Pytorch toolkit for tensor decomposition networks},
journal = {Neurocomputing},
volume = {469},
pages = {234--238},
year = {2022}
}
```