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

SVD fails in __wct_core when cont_feat or styl_feat are [x,1] dimensional matrix #104

Open
dkreinov opened this issue Jul 19, 2020 · 1 comment

Comments

@dkreinov
Copy link

Unless I'm doing something wrong, there is a corner case inside def __wct_core, when one of the matrices is basically a vector.
When calculating:
contentConv = torch.mm(cont_feat, cont_feat.t()).div(cFSize[1] - 1) + iden

cFSize[1] is 1 so there is a division by 0=> and we get a matrix full of NAN which is causing the SVD to fail.

For now, as a w/a inside
def __feature_wct
I've changed the condtion
if cont_mask[0].size <= 0 or styl_mask[0].size <= 0:
continue

to

if cont_mask[0].size <= 1 or styl_mask[0].size <= 1:
continue

to ignore labels that causing this issue.

Any idea why it happens and what is the best approach to fix it?

@dawgster
Copy link

dawgster commented Nov 3, 2021

I am also facing this issue

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