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

function whitening_transformation has produced "nan" value #25

Open
dengyuning opened this issue Apr 13, 2019 · 3 comments
Open

function whitening_transformation has produced "nan" value #25

dengyuning opened this issue Apr 13, 2019 · 3 comments

Comments

@dengyuning
Copy link

I try to train embedding with the supervised method.But I got this error.

@dengyuning dengyuning changed the title ValueError: On entry to DLASCL parameter number 4 had an illegal value function whitening_transformation has produced "nan" value Apr 13, 2019
@dengyuning
Copy link
Author

the svd operation within the whitening_transformation function produce a zero element and then raise a error "divide by zero encountered in true_divide" . Has anyone met the same problem?

u, s, vt = xp.linalg.svd(m, full_matrices=False)
vt.T.dot(xp.diag(1/s)).dot(vt)

@artetxem
Copy link
Owner

What is your vocabulary size? SVD should only produce a 0 value if the rank of the embedding matrix is lower than the dimensionality (i.e. you have less vocabulary entries than the number of dimensions, which should never happen in realistic settings).

@dengyuning
Copy link
Author

I have got a Chinese word embedding which contains 1292607 words and a English word embedding which contains 400000 words. The dimension of them are both 300. I have got a dictionary which contains 20811 word pairs. Is that OK ? Is there anything else that I need to pay attention to ?

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