Questions tagged [tensorly]

TensorLy is a Python library that aims at making tensor learning simple and accessible. It provides a high-level API for tensor methods, including core tensor operations, tensor decomposition, regression, and deep tensorized architectures. It has a flexible backend that allows running operations seamlessly using NumPy, PyTorch, TensorFlow, etc. The project is open source under BSD license which makes it suitable for both academic and commercial use.

TensorLy

TensorLy is an open source machine learning library for simple tensor methods in Python. It has a flexible backend system that allows to seamlessly run code written with TensorLy using NumPy, PyTorch, TensorFlow, MXNet, CuPy or JAX.

Resources

21 questions
5
votes
2 answers

partial tucker decomposition

I want to apply a partial tucker decomposition algorithm to minimize MNIST image tensor dataset of (60000,28,28), in order to conserve its features when applying another machine algorithm afterwards like SVM. I have this code that minimizes the…
user1655410
  • 371
  • 8
  • 26
3
votes
0 answers

What is the equivalent of Tensorlab's Structured Data Fusion in TensorFlow?

I am trying to find symmetric, non-negative low rank tensor approximations. Right now, I am using Tensorlab's Structured Data Fusion model. I have not able to find an equivalent to this is Tensorflow or Tensorly. I would appreciate if anyone could…
fdzsfhaS
  • 79
  • 10
2
votes
1 answer

How do I design a test for the partial_tucker function from tensorly?

I try to design a test in order to verify that the partial_tucker function from tensorly works as I expect it to work. In other words, I want to design an input for the partial_tucker function along with its associated expected output. So, what I…
LucG
  • 1,238
  • 13
  • 25
2
votes
1 answer

Kronecker product source code in TensorLy

I'm trying to understand the code for Kronecker product for tensors implemented in TensorLy. Below is the code: def kron(self, a, b): """Kronecker product of two tensors. Parameters ---------- a, b : tensor The tensors to…
stats_residue
  • 145
  • 1
  • 8
1
vote
1 answer

AttributeError: module 'tensorly' has no attribute 'decomposition'

I’m using a package (tensorly) on python where I don't have access to all the modules. For example if I try to use the 'decomposition' module : python version: 3.9.12 tensorly version : 0.7 I run : pip3 install tensorly python3 main.py main.py…
Snaype _
  • 11
  • 2
1
vote
1 answer

Converting 2D Dataframe to Multidimensional Tensor in Tensorflow (or Tensorly)

I'm very new to python and am trying my hand at higher dimension tensor decomposition techniques. But first I need to convert my dataframe from a 2D array into a multidimensional tensor and I'm kind of stuck on how to do it. My dataframe looks like…
WVimes
  • 47
  • 5
1
vote
1 answer

Python tensorly parafac returning ValueError

I have a set of manufactured data (generated from an explicit mathematical function) stored in a 3-dimensional tensor called A. When I try to run parafac, I receive the following: Traceback (most recent call last): File "./ParafacPrintValues.py",…
Madeleine P. Vincent
  • 3,361
  • 5
  • 25
  • 30
1
vote
1 answer

tensorly.kruskal_to_tensor() method explanation

I'm trying to understand tl.kruskal_to_tensor () method in tensorly package. In the webpage I understand that it takes as input a list of matrices and produces the tensor whose cp-decomposiiton are the matrices? It takes as input a list of…
user42493
  • 813
  • 4
  • 14
  • 34
1
vote
1 answer

Nonnegative tensor decomposition example using Tensorly

I am very new to tensor and also to tensorly Library.I come across one of the best examples of tensor decomposition on jeankossaifi but I need an example of tensorly function non_negative_tucker() for tensor decomposition by extending the example on…
SHIVA
  • 11
  • 2
0
votes
1 answer

How to resolve 'AttributeError: module 'tensorly' has no attribute 'svd' error' when using PARAFAC in Tensorly?

I'm trying to run some sample code I found at this link: http://tensorly.org/stable/auto_examples/decomposition/plot_parafac2.html I plan to use PARAFAC in this library for something else eventually, but just wanted to see if I could get it working…
A55i57
  • 1
0
votes
1 answer

What is rank list in tucker decomposition?

I am going to decompose a 4D tensor using tucker decomposition in python. I found a library, tensorly, to do this. I only want to perform the decomposition on the first and second dimensions. To perform tucker decomposition on some modes (not all…
Kak Milad
  • 1
  • 2
0
votes
1 answer

Why attribute tensor_dot is not found in tensorly

Consider the following code, where I define a function to calculate the Kronecker product of matrices. The goal, is to use tensor_dot from the tensorly library for a tensor extrapolation algorithm. import numpy as np import numpy.linalg as la #%pip…
0
votes
0 answers

How to perform einsum for decomposed tensor operations?

I am trying to measure the speed up performance between np.einsum('bcd,bce,bef->df' tensor1, tensor2, tensor1) and np.einsum('...->...', decomposed_tensor1, tensor2, decomposed_tensor1) operations. The decomposition method I am using is…
Yirmidokuz
  • 127
  • 1
  • 7
0
votes
1 answer

Tensorly and tensor rank (CP rank)

I am trying to compute the tensor rank aka CP rank (https://en.wikipedia.org/wiki/Tensor_rank_decomposition#Tensor_rank) for a specific sparse tensor that is 8 x 8 x 8. I am new to Tensorly and have only just installed. After reading the…
bark
  • 51
  • 4
0
votes
1 answer

Python & Numpy - reshape 10x10 array where each cell is 20x20 array into a 10x10x20x20

I have kind a of weird problem where I have a .mat file that comes in a a 10x10 array where each index is a 20x20 array representing a gray image. So I have 10 trials and each trial are a time series with 10 intervals and each interval is tracked as…
user12314098
1
2