-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
bc3e3a4
commit 55bdab7
Showing
374 changed files
with
15,763 additions
and
8,330 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
This file was deleted.
Oops, something went wrong.
Binary file modified
BIN
+145 Bytes
(100%)
stable/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip
Binary file not shown.
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
Binary file modified
BIN
+156 Bytes
(100%)
stable/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip
Binary file not shown.
54 changes: 54 additions & 0 deletions
54
stable/_downloads/6f392aba7031ac3e4c8365850f77f099/plot_cp_line_search.ipynb
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,54 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"%matplotlib inline" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n# Using line search with PARAFAC\n\nExample on how to use :func:`tensorly.decomposition.parafac` with line search to accelerate convergence.\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import matplotlib.pyplot as plt\n\nfrom time import time\nimport numpy as np\nimport tensorly as tl\nfrom tensorly.random import random_cp\nfrom tensorly.decomposition import CP, parafac\n\ntol = np.logspace(-1, -9)\nerr = np.empty_like(tol)\nerr_ls = np.empty_like(tol)\ntt = np.empty_like(tol)\ntt_ls = np.empty_like(tol)\ntensor = random_cp((10, 10, 10), 3, random_state=1234, full=True)\n\n# Get a high-accuracy decomposition for comparison\nfac = parafac(tensor, rank=3, n_iter_max=2000000, tol=1.0e-15, linesearch=True)\nerr_min = tl.norm(tl.cp_to_tensor(fac) - tensor)\n\nfor ii, toll in enumerate(tol):\n\t# Run PARAFAC decomposition without line search and time\n start = time()\n cp = CP(rank=3, n_iter_max=2000000, tol=toll, linesearch=False)\n fac = cp.fit_transform(tensor)\n tt[ii] = time() - start\n err[ii] = tl.norm(tl.cp_to_tensor(fac) - tensor)\n\n# Run PARAFAC decomposition with line search and time\nfor ii, toll in enumerate(tol):\n start = time()\n cp = CP(rank=3, n_iter_max=2000000, tol=toll, linesearch=True)\n fac_ls = cp.fit_transform(tensor)\n tt_ls[ii] = time() - start\n\n # Calculate the error of both decompositions\n err_ls[ii] = tl.norm(tl.cp_to_tensor(fac_ls) - tensor)\n\n\nfig = plt.figure()\nax = fig.add_subplot(1, 1, 1)\nax.loglog(tt, err - err_min, '.', label=\"No line search\")\nax.loglog(tt_ls, err_ls - err_min, '.r', label=\"Line search\")\nax.legend()\nax.set_ylabel(\"Time\")\nax.set_xlabel(\"Error\")\n\nplt.show()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"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.8.5" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
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
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
54 changes: 0 additions & 54 deletions
54
stable/_downloads/cb64fc91dbcad9e7acccd75909fc6017/parafac_line_search.ipynb
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
Binary file modified
BIN
-1 Byte
(100%)
stable/_images/math/0c9a0b6cbe6dd3838dfec03819156d38a2a79869.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/1060b27e042e5e7224ea357bd9cad0b44248b14f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1 Byte
(100%)
stable/_images/math/129a289826f931be9b704d0f38db8217cef2dfc6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2 Bytes
(100%)
stable/_images/math/1b782627d1b0843af085aa264886d73f35e56715.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/267d50f457b0de0e577cc9fcb19eab6528b8c899.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/38c1e934184582677d3addf0297a1f91c8094fe9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/3c1670a65c8af230b8412e85bd659415a4aba0e7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/49123964effe20fb6ef3ee1778a5e52b9dbb6d73.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
stable/_images/math/501fd4b16bcaea9f025a5e5887f1d6c39080257c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1 Byte
(100%)
stable/_images/math/50500affe5d25ca727daaec3c2a317dc7b57176e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/56be6f5cfc02befc55ca906d00ce27571fc05e2d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/5adc61b02c3e06e38e47acd6acff95b5b12b6a72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2 Bytes
(100%)
stable/_images/math/75f5d5e1b7c7e27bf646ce2310d037a34bebf8b2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10 Bytes
(100%)
stable/_images/math/7bfeae1b7ee675473e7ab395c0ea880330e96a91.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2 Bytes
(100%)
stable/_images/math/7e5cefcc72773fad54dbd09a90444798f81da3c8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/86ddd8406f22c657b5cf4b31103defcc7ce13169.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5 Bytes
(100%)
stable/_images/math/881588c7e264617a22ab13ee01a8a7124b0ac018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2 Bytes
(100%)
stable/_images/math/92fe9d704c81c8a6234d13f01c702aac029a4215.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6 Bytes
(100%)
stable/_images/math/b31e914569cd101eaf7d42500e22550fe7ceec9f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1 Byte
(100%)
stable/_images/math/ba6269823af0bd7948da27251523a178013303d4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/c5461f9eb416012b3cd303ca8f9ce3b5f579d18c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/d58f41145b94a6e17dc8672ac824b056a06cf5ee.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/ddc5a930d6d9dda09f065bea14fa9e4b457f6d90.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1 Byte
(100%)
stable/_images/math/dff3be44c981381be24d1d9c6040c7bde12e79db.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1 Byte
(100%)
stable/_images/math/e3fa2dac9eceee9d62f1257b8cf7d3938b4e5a72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3 Bytes
(100%)
stable/_images/math/eb279446e130e5472e805db0b5c048316ce00204.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
stable/_images/math/f1ef44a8ac7f20c194e0905450031d192ed45621.png
Oops, something went wrong.
Binary file modified
BIN
+1 Byte
(100%)
stable/_images/math/fcdb4cdf192ddb1386b413b62c576921590180b0.png
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.