-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
perry
committed
Apr 1, 2021
1 parent
94bd925
commit 261cf5b
Showing
7 changed files
with
161 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Contact | ||
============ | ||
|
||
This project is mainly developed by Yu Pan etc.. Feel free to contact me at iperryuu@gmail.com. | ||
This project is mainly developed by Yu Pan(iperryuu@gmail.com) and Maolin Wang(morin.w98@gmail.com), etc. Feel free to contact us. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"colab_type": "text", | ||
"id": "gqwrcHFAVwgs" | ||
}, | ||
"source": [ | ||
"# Quick Start" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"colab_type": "text", | ||
"id": "oz-X6ZrGVwgu" | ||
}, | ||
"source": [ | ||
"In this quick starting guide we show the basics of working with t3f library. The main concept of the library is a TensorTrain object – a compact (factorized) representation of a tensor (=multidimensional array). This is generalization of the matrix low-rank decomposition." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": { | ||
"colab": { | ||
"base_uri": "https://localhost:8080/", | ||
"height": 34 | ||
}, | ||
"colab_type": "code", | ||
"id": "ri9QCNEAVwgw", | ||
"outputId": "efd8c64b-836e-449b-a385-dd3a63a5b4a2" | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"\n", | ||
"import tednet as tdt\n", | ||
"import tednet.tnn.tensor_ring as tr" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": { | ||
"colab": {}, | ||
"colab_type": "code", | ||
"id": "5Awp7wdwVwg3" | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"compression_ration is: 0.3968253968253968\n", | ||
"compression_ration is: 14.17233560090703\n", | ||
"compression_ration is: 241.54589371980677\n", | ||
"compression_ration is: 2.867383512544803\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# Define a TR-LeNet5\n", | ||
"model = tr.TRLeNet5(10, [6, 6, 6, 6])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"colab_type": "text", | ||
"id": "i2QmXYqeVwhQ", | ||
"pycharm": { | ||
"name": "#%% md\n" | ||
} | ||
}, | ||
"source": [ | ||
"It is easy to define a tensor ring model.\n" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"colab": { | ||
"collapsed_sections": [], | ||
"name": "riemannian.ipynb", | ||
"provenance": [] | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.7.9" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 1 | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -*- coding: UTF-8 -*- | ||
|
||
import tednet | ||
|
||
import torch | ||
|
||
a = torch.Tensor(6, 8) | ||
b = tednet.to_numpy(a) | ||
c = tednet.to_tensor(b) | ||
d = c.cuda() | ||
e = tednet.to_numpy(d) | ||
f = tednet.to_tensor(e) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters