diff --git a/dev/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip b/dev/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip index 614b5c47..e2ceef4d 100644 Binary files a/dev/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip and b/dev/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip differ diff --git a/dev/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip b/dev/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip index 83a069f7..8e280ed9 100644 Binary files a/dev/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip and b/dev/_downloads/6f1e7a639e0699d6164445b55e6c116d/auto_examples_jupyter.zip differ diff --git a/dev/_images/sphx_glr_plot_cp_line_search_001.png b/dev/_images/sphx_glr_plot_cp_line_search_001.png index f75fcd97..816cdf21 100644 Binary files a/dev/_images/sphx_glr_plot_cp_line_search_001.png and b/dev/_images/sphx_glr_plot_cp_line_search_001.png differ diff --git a/dev/_images/sphx_glr_plot_cp_line_search_thumb.png b/dev/_images/sphx_glr_plot_cp_line_search_thumb.png index f38fc1ac..7bbc3df2 100644 Binary files a/dev/_images/sphx_glr_plot_cp_line_search_thumb.png and b/dev/_images/sphx_glr_plot_cp_line_search_thumb.png differ diff --git a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_001.png b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_001.png index 9219b97f..6f093850 100644 Binary files a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_001.png and b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_001.png differ diff --git a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_002.png b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_002.png index 144e961e..7c30417a 100644 Binary files a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_002.png and b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_002.png differ diff --git a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_003.png b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_003.png index 2849a6cc..d14deb26 100644 Binary files a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_003.png and b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_003.png differ diff --git a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_004.png b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_004.png index 994fa9f0..440dbc4e 100644 Binary files a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_004.png and b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_004.png differ diff --git a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_005.png b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_005.png index 71648287..b0d91f01 100644 Binary files a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_005.png and b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_005.png differ diff --git a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_006.png b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_006.png index 04bd9617..6d831461 100644 Binary files a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_006.png and b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_006.png differ diff --git a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_thumb.png b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_thumb.png index 6fa1f4f5..f6e08095 100644 Binary files a/dev/_images/sphx_glr_plot_guide_for_constrained_cp_thumb.png and b/dev/_images/sphx_glr_plot_guide_for_constrained_cp_thumb.png differ diff --git a/dev/_images/sphx_glr_plot_image_compression_001.png b/dev/_images/sphx_glr_plot_image_compression_001.png index d85ab2fc..6e7c58ba 100644 Binary files a/dev/_images/sphx_glr_plot_image_compression_001.png and b/dev/_images/sphx_glr_plot_image_compression_001.png differ diff --git a/dev/_images/sphx_glr_plot_image_compression_thumb.png b/dev/_images/sphx_glr_plot_image_compression_thumb.png index 27dc6064..0924757b 100644 Binary files a/dev/_images/sphx_glr_plot_image_compression_thumb.png and b/dev/_images/sphx_glr_plot_image_compression_thumb.png differ diff --git a/dev/_images/sphx_glr_plot_nn_cp_hals_001.png b/dev/_images/sphx_glr_plot_nn_cp_hals_001.png index adbe49f7..cab1942a 100644 Binary files a/dev/_images/sphx_glr_plot_nn_cp_hals_001.png and b/dev/_images/sphx_glr_plot_nn_cp_hals_001.png differ diff --git a/dev/_images/sphx_glr_plot_nn_cp_hals_thumb.png b/dev/_images/sphx_glr_plot_nn_cp_hals_thumb.png index 67a567b0..bc6e0948 100644 Binary files a/dev/_images/sphx_glr_plot_nn_cp_hals_thumb.png and b/dev/_images/sphx_glr_plot_nn_cp_hals_thumb.png differ diff --git a/dev/_images/sphx_glr_plot_nn_tucker_001.png b/dev/_images/sphx_glr_plot_nn_tucker_001.png index 844950aa..587f38ad 100644 Binary files a/dev/_images/sphx_glr_plot_nn_tucker_001.png and b/dev/_images/sphx_glr_plot_nn_tucker_001.png differ diff --git a/dev/_images/sphx_glr_plot_nn_tucker_thumb.png b/dev/_images/sphx_glr_plot_nn_tucker_thumb.png index 14171a22..7738bd40 100644 Binary files a/dev/_images/sphx_glr_plot_nn_tucker_thumb.png and b/dev/_images/sphx_glr_plot_nn_tucker_thumb.png differ diff --git a/dev/_images/sphx_glr_plot_permute_factors_001.png b/dev/_images/sphx_glr_plot_permute_factors_001.png index 732a6fdd..ff43e6cd 100644 Binary files a/dev/_images/sphx_glr_plot_permute_factors_001.png and b/dev/_images/sphx_glr_plot_permute_factors_001.png differ diff --git a/dev/_images/sphx_glr_plot_permute_factors_thumb.png b/dev/_images/sphx_glr_plot_permute_factors_thumb.png index be3b621b..bef6e809 100644 Binary files a/dev/_images/sphx_glr_plot_permute_factors_thumb.png and b/dev/_images/sphx_glr_plot_permute_factors_thumb.png differ diff --git a/dev/_modules/tensorly/tenalg/core_tenalg/mttkrp.html b/dev/_modules/tensorly/tenalg/core_tenalg/mttkrp.html index 6417cdb6..3cc236c1 100644 --- a/dev/_modules/tensorly/tenalg/core_tenalg/mttkrp.html +++ b/dev/_modules/tensorly/tenalg/core_tenalg/mttkrp.html @@ -145,7 +145,9 @@

Source code for tensorly.tenalg.core_tenalg.mttkrp

 from .n_mode_product import multi_mode_dot
+from ._khatri_rao import khatri_rao
 from ... import backend as T
+from ...base import unfold
 
 # Author: Jean Kossaifi
 
@@ -171,24 +173,61 @@ 

Source code for tensorly.tenalg.core_tenalg.mttkrp

Notes ----- - This is a variant of:: + Default unfolding_dot_khatri_rao implementation. - unfolded = unfold(tensor, mode) - kr_factors = khatri_rao(factors, skip_matrix=mode) - mttkrp2 = tl.dot(unfolded, kr_factors) + Implemented as the product between an unfolded tensor + and a Khatri-Rao product explicitly formed. Due to matrix-matrix + products being extremely efficient operations, this is a + simple yet hard-to-beat implementation of MTTKRP. - Multiplying with the Khatri-Rao product is equivalent to multiplying, - for each rank, with the kronecker product of each factor. - In code:: + If working with sparse tensors, or when the CP-rank of the CP-tensor is comparable to, or larger than, + the dimensions of the input tensor, however, this method requires a lot + of memory, which can be harmful when dealing with large tensors. In this + case, please use the memory-efficient version of MTTKRP. - mttkrp_parts = [] - for r in range(rank): - component = tl.tenalg.multi_mode_dot(tensor, [f[:, r] for f in factors], skip=mode) - mttkrp_parts.append(component) - mttkrp = tl.stack(mttkrp_parts, axis=1) - return mttkrp + To use the slower memory efficient version, run - This can be done by taking n-mode-product with the full factors + >>> from tensorly.tenalg.core_tenalg.mttkrp import unfolding_dot_khatri_rao_memory + >>> tl.tenalg.register_backend_method("unfolding_dot_khatri_rao", unfolding_dot_khatri_rao_memory) + >>> tl.tenalg.use_dynamic_dispatch() + + """ + weights, factors = cp_tensor + kr_factors = khatri_rao(factors, weights=weights, skip_matrix=mode) + mttkrp = T.dot(unfold(tensor, mode), T.conj(kr_factors)) + return mttkrp
+ + + +def unfolding_dot_khatri_rao_memory(tensor, cp_tensor, mode): + """mode-n unfolding times khatri-rao product of factors + + Parameters + ---------- + tensor : tl.tensor + tensor to unfold + factors : tl.tensor list + list of matrices of which to the khatri-rao product + mode : int + mode on which to unfold `tensor` + + Returns + ------- + mttkrp + dot(unfold(tensor, mode), khatri-rao(factors)) + + Notes + ----- + Implemented as a sequence of Tensor-times-vectors products between a tensor + and a Khatri-Rao product. The Khatri-Rao product is never computed explicitly, + rather each column in the Khatri-Rao product is contracted with the tensor. This + operation is implemented in Python and without making of use of parallelism, and it + is therefore in general slower than the naive MTTKRP product. + When the CP-rank of the CP-tensor is comparable to, or larger than, + the dimensions of the input tensor, this method however requires much less + memory. + + This method can also be implemented by taking n-mode-product with the full factors (faster but more memory consuming):: projected = multi_mode_dot(tensor, factors, skip=mode, transpose=True) @@ -198,22 +237,6 @@

Source code for tensorly.tenalg.core_tenalg.mttkrp

index = tuple([slice(None) if k == mode else i for k in range(ndims)]) res.append(projected[index]) return T.stack(res, axis=-1) - - - The same idea could be expressed using einsum:: - - ndims = tl.ndim(tensor) - tensor_idx = ''.join(chr(ord('a') + i) for i in range(ndims)) - rank = chr(ord('a') + ndims + 1) - op = tensor_idx - for i in range(ndims): - if i != mode: - op += ',' + ''.join([tensor_idx[i], rank]) - else: - result = ''.join([tensor_idx[i], rank]) - op += '->' + result - factors = [f for (i, f) in enumerate(factors) if i != mode] - return tl_einsum(op, tensor, *factors) """ mttkrp_parts = [] weights, factors = cp_tensor @@ -227,8 +250,7 @@

Source code for tensorly.tenalg.core_tenalg.mttkrp

if weights is None: return T.stack(mttkrp_parts, axis=1) else: - return T.stack(mttkrp_parts, axis=1) * T.reshape(weights, (1, -1))
- + return T.stack(mttkrp_parts, axis=1) * T.reshape(weights, (1, -1))
diff --git a/dev/_sources/auto_examples/applications/plot_IL2.rst.txt b/dev/_sources/auto_examples/applications/plot_IL2.rst.txt index 1908281c..e7fed850 100644 --- a/dev/_sources/auto_examples/applications/plot_IL2.rst.txt +++ b/dev/_sources/auto_examples/applications/plot_IL2.rst.txt @@ -242,7 +242,7 @@ affect IL-2 signaling in immune cells. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 1.723 seconds) + **Total running time of the script:** (0 minutes 1.444 seconds) .. _sphx_glr_download_auto_examples_applications_plot_IL2.py: diff --git a/dev/_sources/auto_examples/applications/plot_covid.rst.txt b/dev/_sources/auto_examples/applications/plot_covid.rst.txt index 8275d48a..246a9be1 100644 --- a/dev/_sources/auto_examples/applications/plot_covid.rst.txt +++ b/dev/_sources/auto_examples/applications/plot_covid.rst.txt @@ -201,7 +201,7 @@ how each component looks like on weights. .. code-block:: none - + @@ -228,7 +228,7 @@ References .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 6.886 seconds) + **Total running time of the script:** (0 minutes 4.097 seconds) .. _sphx_glr_download_auto_examples_applications_plot_covid.py: diff --git a/dev/_sources/auto_examples/applications/plot_image_compression.rst.txt b/dev/_sources/auto_examples/applications/plot_image_compression.rst.txt index def23484..a9fe8883 100644 --- a/dev/_sources/auto_examples/applications/plot_image_compression.rst.txt +++ b/dev/_sources/auto_examples/applications/plot_image_compression.rst.txt @@ -112,7 +112,7 @@ Example on how to use :func:`tensorly.decomposition.parafac` and :func:`tensorly .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 3.524 seconds) + **Total running time of the script:** (0 minutes 1.435 seconds) .. _sphx_glr_download_auto_examples_applications_plot_image_compression.py: diff --git a/dev/_sources/auto_examples/applications/sg_execution_times.rst.txt b/dev/_sources/auto_examples/applications/sg_execution_times.rst.txt index 79ee1262..13fc664d 100644 --- a/dev/_sources/auto_examples/applications/sg_execution_times.rst.txt +++ b/dev/_sources/auto_examples/applications/sg_execution_times.rst.txt @@ -6,7 +6,7 @@ Computation times ================= -**00:12.133** total execution time for 3 files **from auto_examples/applications**: +**00:06.976** total execution time for 3 files **from auto_examples/applications**: .. container:: @@ -33,11 +33,11 @@ Computation times - Time - Mem (MB) * - :ref:`sphx_glr_auto_examples_applications_plot_covid.py` (``plot_covid.py``) - - 00:06.886 - - 0.0 - * - :ref:`sphx_glr_auto_examples_applications_plot_image_compression.py` (``plot_image_compression.py``) - - 00:03.524 + - 00:04.097 - 0.0 * - :ref:`sphx_glr_auto_examples_applications_plot_IL2.py` (``plot_IL2.py``) - - 00:01.723 + - 00:01.444 + - 0.0 + * - :ref:`sphx_glr_auto_examples_applications_plot_image_compression.py` (``plot_image_compression.py``) + - 00:01.435 - 0.0 diff --git a/dev/_sources/auto_examples/decomposition/plot_cp_line_search.rst.txt b/dev/_sources/auto_examples/decomposition/plot_cp_line_search.rst.txt index 70bde926..8fd60428 100644 --- a/dev/_sources/auto_examples/decomposition/plot_cp_line_search.rst.txt +++ b/dev/_sources/auto_examples/decomposition/plot_cp_line_search.rst.txt @@ -88,7 +88,7 @@ Example on how to use :func:`tensorly.decomposition.parafac` with line search to .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 9.561 seconds) + **Total running time of the script:** (0 minutes 5.194 seconds) .. _sphx_glr_download_auto_examples_decomposition_plot_cp_line_search.py: diff --git a/dev/_sources/auto_examples/decomposition/plot_guide_for_constrained_cp.rst.txt b/dev/_sources/auto_examples/decomposition/plot_guide_for_constrained_cp.rst.txt index 4478f766..10d37bdb 100644 --- a/dev/_sources/auto_examples/decomposition/plot_guide_for_constrained_cp.rst.txt +++ b/dev/_sources/auto_examples/decomposition/plot_guide_for_constrained_cp.rst.txt @@ -240,21 +240,21 @@ a python dictionary: .. code-block:: none 1. factor - [[3.83 0. 0.6 ] - [3.57 0. 0.07] - [4.63 1.55 0.86] - [6.27 0.97 2.23] - [5.64 0.96 1.35] - [7.02 0.9 2.72]] + [[4.6 0.65 0.98] + [4.79 0.78 0.56] + [4.68 0.87 0.87] + [3.63 1.77 1.97] + [4.16 1.63 1.81] + [4.48 1.1 0.86]] 2. factor - [[ 0.41 -0.17 -0.33] - [ 0.4 0.06 -0.42] - [ 0.42 0.1 -0.5 ] - [ 0.37 0.66 -0.58] - [ 0.44 -0.6 -0.39] - [ 0.43 0.27 -0.64] - [ 0.41 -0.31 -0.51] - [ 0.38 0.18 -0.55]] + [[ 0.22 0.67 -0.18] + [ 0.37 -0.04 0.13] + [ 0.33 -0.24 0.52] + [ 0.38 -0.85 0.86] + [ 0.29 -0.02 0.31] + [ 0.32 0.64 -0.4 ] + [ 0.28 0.61 -0.33] + [ 0.4 -0.76 0.51]] @@ -365,32 +365,32 @@ only `True` depending on the selected constraint. .. code-block:: none 1. factor - [[ 18.97 -17.93 -7.8 ] - [ 19.67 -24.39 -1.47] - [ 19.5 -8.36 -5.33] - [ 9.71 15.28 16.51] - [ 16.16 -6.45 10.39] - [ 12.05 6.65 13.63]] + [[15.09 -4.49 5.42] + [14.94 -3.67 5.59] + [15.03 10.82 4.88] + [11.44 -3.01 14.39] + [13.79 7.82 9.56] + [14.17 13.23 5.75]] 2. factor - [[0.44 1.22 0.42] - [0.39 0.55 0.62] - [0.38 0. 0.57] - [0.4 0.81 0. ] - [0.39 0.42 0.43] - [0.36 0.37 0.53] - [0.31 0. 0.53] - [0.33 0.08 0.36]] + [[0.34 1.43 0.52] + [0.42 0. 0.29] + [0.36 0.3 0.7 ] + [0.33 0. 0.63] + [0.34 0. 0.61] + [0.44 0.18 0.05] + [0.38 0. 0.3 ] + [0.35 0. 0.08]] 3. factor - [[ 0.08 -0.01 0.03] - [ 0.08 0.02 0.03] - [ 0.08 0.02 -0.02] - [ 0.07 -0.01 0.02] - [ 0.08 0.01 0.02] - [ 0.08 0.01 0.01] - [ 0.06 -0.01 0.04] - [ 0.08 0.02 0.01] - [ 0.08 0.02 0. ] - [ 0.07 0.01 0.05]] + [[ 0.06 0. 0.07] + [ 0.09 0.02 -0. ] + [ 0.09 -0.01 0. ] + [ 0.08 0.01 0.04] + [ 0.06 0.02 0.05] + [ 0.08 0.03 0.01] + [ 0.12 -0.02 -0.01] + [ 0.07 -0.01 0.04] + [ 0.07 -0.02 0.02] + [ 0.1 0. -0.01]] @@ -416,7 +416,7 @@ IEEE Transactions on Signal Processing 64.19 (2016): 5052-5065. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 4.667 seconds) + **Total running time of the script:** (0 minutes 4.547 seconds) .. _sphx_glr_download_auto_examples_decomposition_plot_guide_for_constrained_cp.py: diff --git a/dev/_sources/auto_examples/decomposition/plot_nn_cp_hals.rst.txt b/dev/_sources/auto_examples/decomposition/plot_nn_cp_hals.rst.txt index 86441520..ef0b6407 100644 --- a/dev/_sources/auto_examples/decomposition/plot_nn_cp_hals.rst.txt +++ b/dev/_sources/auto_examples/decomposition/plot_nn_cp_hals.rst.txt @@ -157,11 +157,11 @@ the case but the approximation is quite coarse. .. code-block:: none reconstructed tensor - [[[8122.51 8527.78] - [7602.15 8553.97]] + [[[8339.46 8385.85] + [8482.02 8314.91]] - [[8856.23 9085.41] - [8355.52 9077.47]]] + [[9022.14 9120.01] + [9121.18 9020.65]]] input data tensor [[[8210. 8211.] @@ -218,11 +218,11 @@ Again, we can look at the reconstructed tensor entries. .. code-block:: none reconstructed tensor - [[[8199.7 8201.79] - [8218. 8208.66]] + [[[8211.58 8210.53] + [8232.58 8234.39]] - [[9000.56 9002.48] - [9018.87 9010.79]]] + [[9011.52 9010.65] + [9032.35 9034.05]]] input data tensor [[[8210. 8211.] @@ -287,9 +287,9 @@ First comparison option is processing time for each algorithm: .. code-block:: none - 0.21 seconds - 0.35 seconds - 116.74 seconds + 0.04 seconds + 0.04 seconds + 116.34 seconds @@ -322,9 +322,9 @@ In Tensorly, we provide a function to calculate Root Mean Square Error (RMSE): .. code-block:: none - 229.19572 - 17.95952 - 0.4071443 + 226.07481 + 4.026286 + 0.7840668 @@ -386,7 +386,7 @@ Neural computation, 24(4), 1085-1105. (Link) .. rst-class:: sphx-glr-timing - **Total running time of the script:** (1 minutes 57.373 seconds) + **Total running time of the script:** (1 minutes 56.486 seconds) .. _sphx_glr_download_auto_examples_decomposition_plot_nn_cp_hals.py: diff --git a/dev/_sources/auto_examples/decomposition/plot_nn_tucker.rst.txt b/dev/_sources/auto_examples/decomposition/plot_nn_tucker.rst.txt index 61c25898..fff6d35a 100644 --- a/dev/_sources/auto_examples/decomposition/plot_nn_tucker.rst.txt +++ b/dev/_sources/auto_examples/decomposition/plot_nn_tucker.rst.txt @@ -207,8 +207,8 @@ processing time: .. code-block:: none time for tensorly nntucker: 0.09 - time for HALS with fista: 1.26 - time for HALS with as: 0.31 + time for HALS with fista: 1.24 + time for HALS with as: 0.34 @@ -238,9 +238,9 @@ to compute Root Mean Square Error (RMSE): .. code-block:: none - RMSE tensorly nntucker: 285.0544765115807 - RMSE for hals with fista: 281.90474318437265 - RMSE for hals with as: 282.5328542921823 + RMSE tensorly nntucker: 285.80975994977814 + RMSE for hals with fista: 281.61298947939366 + RMSE for hals with as: 281.92985708859294 diff --git a/dev/_sources/auto_examples/decomposition/plot_parafac2.rst.txt b/dev/_sources/auto_examples/decomposition/plot_parafac2.rst.txt index 5d720454..cc256507 100644 --- a/dev/_sources/auto_examples/decomposition/plot_parafac2.rst.txt +++ b/dev/_sources/auto_examples/decomposition/plot_parafac2.rst.txt @@ -141,45 +141,45 @@ with the lowest error Training model 0... Number of iterations: 92 - Final error: 0.09204691256270857 + Final error: 0.09204691256270965 ------------------------------- Training model 1... Number of iterations: 97 - Final error: 0.09204691443830902 + Final error: 0.09204691443830794 ------------------------------- Training model 2... Number of iterations: 126 - Final error: 0.09269641747988852 + Final error: 0.09269641747988637 ------------------------------- Training model 3... Number of iterations: 62 - Final error: 0.09204691834914164 + Final error: 0.09204691834914272 ------------------------------- Training model 4... Number of iterations: 68 - Final error: 0.09204691374344776 + Final error: 0.0920469137434456 ------------------------------- Training model 5... Number of iterations: 217 - Final error: 0.09290488334817881 + Final error: 0.09290488334817987 ------------------------------- Training model 6... Number of iterations: 64 - Final error: 0.09204692065975402 + Final error: 0.09204692065975076 ------------------------------- Training model 7... Number of iterations: 66 - Final error: 0.09204691491864322 + Final error: 0.09204691491864214 ------------------------------- Training model 8... Number of iterations: 83 - Final error: 0.09204690965867544 + Final error: 0.09204690965867653 ------------------------------- Training model 9... Number of iterations: 117 - Final error: 0.09204691029003553 + Final error: 0.09204691029003445 ------------------------------- - Best model error: 0.09204690965867544 + Best model error: 0.09204690965867653 @@ -283,7 +283,7 @@ Compute performance metrics .. code-block:: none 91% of the data is explained by the model, which is expected with noise rate: 0.1 - Average tucker congruence coefficient: 0.9946799176083392 + Average tucker congruence coefficient: 0.9946799176083382 @@ -354,7 +354,7 @@ Visualize the components .. code-block:: none - + @@ -414,7 +414,7 @@ A direct fitting algorithm for the PARAFAC2 model.* .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 17.464 seconds) + **Total running time of the script:** (0 minutes 13.850 seconds) .. _sphx_glr_download_auto_examples_decomposition_plot_parafac2.py: diff --git a/dev/_sources/auto_examples/decomposition/plot_parafac2_compression.rst.txt b/dev/_sources/auto_examples/decomposition/plot_parafac2_compression.rst.txt index e682f0a9..4eb42328 100644 --- a/dev/_sources/auto_examples/decomposition/plot_parafac2_compression.rst.txt +++ b/dev/_sources/auto_examples/decomposition/plot_parafac2_compression.rst.txt @@ -158,7 +158,7 @@ with the lowest reconstruction error. .. code-block:: none Fitting PARAFAC2 model without compression... - It took 52.5s to fit a PARAFAC2 model a tensor of shape (10, 10000, 15) without compression + It took 47.6s to fit a PARAFAC2 model a tensor of shape (10, 10000, 15) without compression @@ -217,8 +217,8 @@ we just need to perform the compression once for the whole grid search as well. .. code-block:: none Fitting PARAFAC2 model with SVD compression... - It took 35.9s to fit a PARAFAC2 model a tensor of shape (10, 10000, 15) with lossless SVD compression - The compression took 0.0s and the fitting took 35.9s + It took 26.5s to fit a PARAFAC2 model a tensor of shape (10, 10000, 15) with lossless SVD compression + The compression took 0.0s and the fitting took 26.5s @@ -279,8 +279,8 @@ removing the parts of the data matrices that have a very low "signal strength". .. code-block:: none Fitting PARAFAC2 model with lossy SVD compression... - It took 35.9s to fit a PARAFAC2 model a tensor of shape (10, 10000, 15) with lossy SVD compression - Of which the compression took 0.0s and the fitting took 35.8s + It took 26.1s to fit a PARAFAC2 model a tensor of shape (10, 10000, 15) with lossy SVD compression + Of which the compression took 0.0s and the fitting took 26.1s @@ -358,7 +358,7 @@ Again, we start by fitting without compression as a baseline. .. code-block:: none Fitting PARAFAC2 model without compression... - It took 113.1s to fit a PARAFAC2 model a tensor of shape (10, 2000, 2000) without compression + It took 112.5s to fit a PARAFAC2 model a tensor of shape (10, 2000, 2000) without compression @@ -412,8 +412,8 @@ Next, we fit with lossless compression. .. code-block:: none Fitting PARAFAC2 model with SVD compression... - It took 105.6s to fit a PARAFAC2 model a tensor of shape (10, 2000, 2000) with lossless SVD compression - Of which the compression took 0.0s and the fitting took 105.6s + It took 107.6s to fit a PARAFAC2 model a tensor of shape (10, 2000, 2000) with lossless SVD compression + Of which the compression took 0.0s and the fitting took 107.6s @@ -474,8 +474,8 @@ Finally, we fit with lossy SVD compression. .. code-block:: none Fitting PARAFAC2 model with lossy SVD compression... - It took 31.3s to fit a PARAFAC2 model a tensor of shape (10, 2000, 2000) with lossy SVD compression - Of which the compression took 12.2s and the fitting took 19.1s + It took 31.6s to fit a PARAFAC2 model a tensor of shape (10, 2000, 2000) with lossy SVD compression + Of which the compression took 12.2s and the fitting took 19.4s @@ -491,7 +491,7 @@ PARAFAC2. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (6 minutes 15.470 seconds) + **Total running time of the script:** (5 minutes 53.021 seconds) .. _sphx_glr_download_auto_examples_decomposition_plot_parafac2_compression.py: diff --git a/dev/_sources/auto_examples/decomposition/plot_permute_factors.rst.txt b/dev/_sources/auto_examples/decomposition/plot_permute_factors.rst.txt index 31127c35..1aeeb468 100644 --- a/dev/_sources/auto_examples/decomposition/plot_permute_factors.rst.txt +++ b/dev/_sources/auto_examples/decomposition/plot_permute_factors.rst.txt @@ -175,7 +175,7 @@ before and after permuting. .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 0.171 seconds) + **Total running time of the script:** (0 minutes 0.130 seconds) .. _sphx_glr_download_auto_examples_decomposition_plot_permute_factors.py: diff --git a/dev/_sources/auto_examples/decomposition/sg_execution_times.rst.txt b/dev/_sources/auto_examples/decomposition/sg_execution_times.rst.txt index d10e91d4..d217a49f 100644 --- a/dev/_sources/auto_examples/decomposition/sg_execution_times.rst.txt +++ b/dev/_sources/auto_examples/decomposition/sg_execution_times.rst.txt @@ -6,7 +6,7 @@ Computation times ================= -**08:46.459** total execution time for 7 files **from auto_examples/decomposition**: +**08:14.983** total execution time for 7 files **from auto_examples/decomposition**: .. container:: @@ -33,23 +33,23 @@ Computation times - Time - Mem (MB) * - :ref:`sphx_glr_auto_examples_decomposition_plot_parafac2_compression.py` (``plot_parafac2_compression.py``) - - 06:15.470 + - 05:53.021 - 0.0 * - :ref:`sphx_glr_auto_examples_decomposition_plot_nn_cp_hals.py` (``plot_nn_cp_hals.py``) - - 01:57.373 + - 01:56.486 - 0.0 * - :ref:`sphx_glr_auto_examples_decomposition_plot_parafac2.py` (``plot_parafac2.py``) - - 00:17.464 + - 00:13.850 - 0.0 * - :ref:`sphx_glr_auto_examples_decomposition_plot_cp_line_search.py` (``plot_cp_line_search.py``) - - 00:09.561 + - 00:05.194 - 0.0 * - :ref:`sphx_glr_auto_examples_decomposition_plot_guide_for_constrained_cp.py` (``plot_guide_for_constrained_cp.py``) - - 00:04.667 + - 00:04.547 - 0.0 * - :ref:`sphx_glr_auto_examples_decomposition_plot_nn_tucker.py` (``plot_nn_tucker.py``) - 00:01.754 - 0.0 * - :ref:`sphx_glr_auto_examples_decomposition_plot_permute_factors.py` (``plot_permute_factors.py``) - - 00:00.171 + - 00:00.130 - 0.0 diff --git a/dev/_sources/auto_examples/plot_tensor.rst.txt b/dev/_sources/auto_examples/plot_tensor.rst.txt index 83ea2457..d1519523 100644 --- a/dev/_sources/auto_examples/plot_tensor.rst.txt +++ b/dev/_sources/auto_examples/plot_tensor.rst.txt @@ -133,7 +133,7 @@ Re-folding the tensor is as easy: .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 0.099 seconds) + **Total running time of the script:** (0 minutes 0.012 seconds) .. _sphx_glr_download_auto_examples_plot_tensor.py: diff --git a/dev/_sources/auto_examples/regression/plot_cp_regression.rst.txt b/dev/_sources/auto_examples/regression/plot_cp_regression.rst.txt index 2a0a38f0..a9169ade 100644 --- a/dev/_sources/auto_examples/regression/plot_cp_regression.rst.txt +++ b/dev/_sources/auto_examples/regression/plot_cp_regression.rst.txt @@ -101,7 +101,7 @@ Example on how to use :class:`tensorly.regression.cp_regression.CPRegressor` to .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 5.343 seconds) + **Total running time of the script:** (0 minutes 5.352 seconds) .. _sphx_glr_download_auto_examples_regression_plot_cp_regression.py: diff --git a/dev/_sources/auto_examples/regression/plot_tucker_regression.rst.txt b/dev/_sources/auto_examples/regression/plot_tucker_regression.rst.txt index 68b64015..63d5697d 100644 --- a/dev/_sources/auto_examples/regression/plot_tucker_regression.rst.txt +++ b/dev/_sources/auto_examples/regression/plot_tucker_regression.rst.txt @@ -130,7 +130,7 @@ Example on how to use :class:`tensorly.regression.tucker_regression.TuckerRegres .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 1.279 seconds) + **Total running time of the script:** (0 minutes 1.273 seconds) .. _sphx_glr_download_auto_examples_regression_plot_tucker_regression.py: diff --git a/dev/_sources/auto_examples/regression/sg_execution_times.rst.txt b/dev/_sources/auto_examples/regression/sg_execution_times.rst.txt index 193959f8..24e540eb 100644 --- a/dev/_sources/auto_examples/regression/sg_execution_times.rst.txt +++ b/dev/_sources/auto_examples/regression/sg_execution_times.rst.txt @@ -6,7 +6,7 @@ Computation times ================= -**00:06.622** total execution time for 2 files **from auto_examples/regression**: +**00:06.624** total execution time for 2 files **from auto_examples/regression**: .. container:: @@ -33,8 +33,8 @@ Computation times - Time - Mem (MB) * - :ref:`sphx_glr_auto_examples_regression_plot_cp_regression.py` (``plot_cp_regression.py``) - - 00:05.343 + - 00:05.352 - 0.0 * - :ref:`sphx_glr_auto_examples_regression_plot_tucker_regression.py` (``plot_tucker_regression.py``) - - 00:01.279 + - 00:01.273 - 0.0 diff --git a/dev/_sources/auto_examples/sg_execution_times.rst.txt b/dev/_sources/auto_examples/sg_execution_times.rst.txt index 502530de..35ff36d9 100644 --- a/dev/_sources/auto_examples/sg_execution_times.rst.txt +++ b/dev/_sources/auto_examples/sg_execution_times.rst.txt @@ -6,7 +6,7 @@ Computation times ================= -**00:00.099** total execution time for 1 file **from auto_examples**: +**00:00.012** total execution time for 1 file **from auto_examples**: .. container:: @@ -33,5 +33,5 @@ Computation times - Time - Mem (MB) * - :ref:`sphx_glr_auto_examples_plot_tensor.py` (``plot_tensor.py``) - - 00:00.099 + - 00:00.012 - 0.0 diff --git a/dev/_sources/sg_execution_times.rst.txt b/dev/_sources/sg_execution_times.rst.txt index 6ccc756a..01dbcd47 100644 --- a/dev/_sources/sg_execution_times.rst.txt +++ b/dev/_sources/sg_execution_times.rst.txt @@ -6,7 +6,7 @@ Computation times ================= -**09:05.313** total execution time for 13 files **from all galleries**: +**08:28.596** total execution time for 13 files **from all galleries**: .. container:: @@ -33,41 +33,41 @@ Computation times - Time - Mem (MB) * - :ref:`sphx_glr_auto_examples_decomposition_plot_parafac2_compression.py` (``../examples/decomposition/plot_parafac2_compression.py``) - - 06:15.470 + - 05:53.021 - 0.0 * - :ref:`sphx_glr_auto_examples_decomposition_plot_nn_cp_hals.py` (``../examples/decomposition/plot_nn_cp_hals.py``) - - 01:57.373 + - 01:56.486 - 0.0 * - :ref:`sphx_glr_auto_examples_decomposition_plot_parafac2.py` (``../examples/decomposition/plot_parafac2.py``) - - 00:17.464 - - 0.0 - * - :ref:`sphx_glr_auto_examples_decomposition_plot_cp_line_search.py` (``../examples/decomposition/plot_cp_line_search.py``) - - 00:09.561 - - 0.0 - * - :ref:`sphx_glr_auto_examples_applications_plot_covid.py` (``../examples/applications/plot_covid.py``) - - 00:06.886 + - 00:13.850 - 0.0 * - :ref:`sphx_glr_auto_examples_regression_plot_cp_regression.py` (``../examples/regression/plot_cp_regression.py``) - - 00:05.343 + - 00:05.352 + - 0.0 + * - :ref:`sphx_glr_auto_examples_decomposition_plot_cp_line_search.py` (``../examples/decomposition/plot_cp_line_search.py``) + - 00:05.194 - 0.0 * - :ref:`sphx_glr_auto_examples_decomposition_plot_guide_for_constrained_cp.py` (``../examples/decomposition/plot_guide_for_constrained_cp.py``) - - 00:04.667 + - 00:04.547 - 0.0 - * - :ref:`sphx_glr_auto_examples_applications_plot_image_compression.py` (``../examples/applications/plot_image_compression.py``) - - 00:03.524 + * - :ref:`sphx_glr_auto_examples_applications_plot_covid.py` (``../examples/applications/plot_covid.py``) + - 00:04.097 - 0.0 * - :ref:`sphx_glr_auto_examples_decomposition_plot_nn_tucker.py` (``../examples/decomposition/plot_nn_tucker.py``) - 00:01.754 - 0.0 * - :ref:`sphx_glr_auto_examples_applications_plot_IL2.py` (``../examples/applications/plot_IL2.py``) - - 00:01.723 + - 00:01.444 + - 0.0 + * - :ref:`sphx_glr_auto_examples_applications_plot_image_compression.py` (``../examples/applications/plot_image_compression.py``) + - 00:01.435 - 0.0 * - :ref:`sphx_glr_auto_examples_regression_plot_tucker_regression.py` (``../examples/regression/plot_tucker_regression.py``) - - 00:01.279 + - 00:01.273 - 0.0 * - :ref:`sphx_glr_auto_examples_decomposition_plot_permute_factors.py` (``../examples/decomposition/plot_permute_factors.py``) - - 00:00.171 + - 00:00.130 - 0.0 * - :ref:`sphx_glr_auto_examples_plot_tensor.py` (``../examples/plot_tensor.py``) - - 00:00.099 + - 00:00.012 - 0.0 diff --git a/dev/auto_examples/applications/plot_IL2.html b/dev/auto_examples/applications/plot_IL2.html index 28650c8c..cef66b31 100644 --- a/dev/auto_examples/applications/plot_IL2.html +++ b/dev/auto_examples/applications/plot_IL2.html @@ -318,7 +318,7 @@ By plotting the correlations which time and dose have with each component, we could additionally make inferences as to the dynamics and dose dependence of how mutations affect IL-2 signaling in immune cells.

-

Total running time of the script: (0 minutes 1.723 seconds)

+

Total running time of the script: (0 minutes 1.444 seconds)

-samples, antigens, receptors
<matplotlib.colorbar.Colorbar object at 0x7f884c658e20>
+samples, antigens, receptors
<matplotlib.colorbar.Colorbar object at 0x7f5568575690>
 

From the results, we can see that serum COVID-19 immunity separates into two distinct signals, @@ -314,7 +314,7 @@

References

https://www.sciencedirect.com/science/article/pii/S0092867420314598

-

Total running time of the script: (0 minutes 6.886 seconds)

+

Total running time of the script: (0 minutes 4.097 seconds)

-

Total running time of the script: (0 minutes 3.524 seconds)

+

Total running time of the script: (0 minutes 1.435 seconds)