JeanKossaifi / tensorly-notebooks

Tensor methods in Python with TensorLy
427 stars 126 forks source link

Nonnegative Tucker Decomposition error #4

Closed iamjli closed 6 years ago

iamjli commented 6 years ago

Hello! I am receiving an error when performing nonnegative Tucker decomposition. Regular Tucker decomposition works fine, and so does PARAFAC and nonnegative PARAFAC.

image

JeanKossaifi commented 6 years ago

Hey @iamjli, This would probably be best posted in the main tensorly repo. The issue comes from the fact that you are only passing one rank (int) instead of a list (one rank for each of the three modes, i.e. the dimension of the core). Also you probably want to assign the result to a core and a list of factors.

In code:

core, factors = non_negative_tucker(X, ranks=[2, 2, 2])

The error should be more informative though and we could use the rank provided for all modes, will change this!