vecmap icon indicating copy to clipboard operation
vecmap copied to clipboard

function whitening_transformation has produced "nan" value

Open dengyuning opened this issue 5 years ago • 3 comments

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

dengyuning avatar Apr 13 '19 05:04 dengyuning

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)

dengyuning avatar Apr 13 '19 10:04 dengyuning

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).

artetxem avatar Apr 16 '19 12:04 artetxem

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 ?

dengyuning avatar Apr 28 '19 04:04 dengyuning