Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init mode == "random" does not return the correct shape in initialize_tucker #518

Closed
hello-fri-end opened this issue Aug 7, 2023 · 3 comments

Comments

@hello-fri-end
Copy link
Contributor

hello-fri-end commented Aug 7, 2023

Modes are not considered when init is random:

elif init == "random":
rng = tl.check_random_state(random_state)
core = tl.tensor(
rng.random_sample(rank) + 0.01, **tl.context(tensor)
) # Check this
factors = [
tl.tensor(rng.random_sample(s), **tl.context(tensor))
for s in zip(tl.shape(tensor), rank)
]

When init is random, do we always assume that all modes should be considered? init == svd allows to initialize along specific modes.

Morever, in the following test init is svd while it should be random
https://github.com/tensorly/tensorly/blob/main/tensorly/decomposition/tests/test_tucker.py#L59-L64

@JeanKossaifi
Copy link
Member

You are absolutely right, thanks for highlighting @hello-fri-end! Would be great if you could open a small PR to fix it!

@hello-fri-end
Copy link
Contributor Author

You are absolutely right, thanks for highlighting @hello-fri-end! Would be great if you could open a small PR to fix it!

Sure, created a PR here to fix the same: #519

@hello-fri-end
Copy link
Contributor Author

Fixed in #519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants