tucker with sparse core tensor #376
renjithravindran
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Hi Renjith, Tensorly already supports some sparse operations Link. You can try Tucker decomposition with a sparse tensor as following example: import sparse
import numpy as np
import tensorly.contrib.sparse as stl
from tensorly.contrib.sparse.decomposition import tucker
from tensorly.contrib.sparse import tucker_to_tensor
coords = np.random.randint(0, 100, size=[3, 24])
data = list(range(1, 25))
X = sparse.COO(coords, data, shape=(100, 100, 100))
tensorly_tensor = stl.tensor(X, dtype='float')
core, factors = tucker(tensorly_tensor, rank=5, init='random')
res = tucker_to_tensor((core, factors)) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi team Tensorly,
Is there any plan to add sparsity constraints to tucker decomposition?
I would like to have tucker with sparse core tensor.
If someone can show me how it can be done in the HOOI framework, i can give a try.
Thanks,
Renjith
Beta Was this translation helpful? Give feedback.
All reactions