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

cplx_trabelsi_independent_ not working for CplxLinear layer #11

Closed
Ujjawal-K-Panchal opened this issue Aug 14, 2020 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@Ujjawal-K-Panchal
Copy link

I was trying to use cplxmodule.nn.init.cplx_trabelsi_independent_ for the cplxmodule.nn.CplxLinear layer as given in the minimalistic snipped below.

from cplxmodule.nn import CplxLinear
from cplxmodule.nn.init import cplx_trabelsi_independent_ 

fc1 = CplxLinear(1250,500)
cplx_trabelsi_independent_(fc1.weight)

However, it gives me the below provided error. Am I using it incorrectly? Help is appreciated.
File "<path>/python3.7/site-packages/cplxmodule/nn/init.py", line 114, in cplx_trabelsi_independent_ M = M.reshape(cplx.shape) ValueError: cannot reshape array of size 250000 into shape (500,1250)

@ivannz ivannz self-assigned this Aug 14, 2020
@ivannz ivannz added the bug Something isn't working label Aug 14, 2020
@ivannz
Copy link
Owner

ivannz commented Aug 14, 2020

Thank you for drawing my attention to this, @Ujjawal-K-Panchal ! due to somewhat late stage addition of that particular init haven't tested it thoroughly. Judging by the issues that accumulate around it i should have been more attentive. i will take care of this issue tomorrow evening.

@ivannz
Copy link
Owner

ivannz commented Aug 15, 2020

@Ujjawal-K-Panchal So it turns out I used full_matrices=False in the SVD, which is being used to produce a semi-unitary init matrix. This led to the an incompatible matrix shape in the case when the linear layer maps n-dim features to m-dim features with n > m. This has gone unnoticed, because I did not implement a proper test suite.

It is fixed now.

@Ujjawal-K-Panchal
Copy link
Author

Thank you for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants