line icon indicating copy to clipboard operation
line copied to clipboard

How can i get embedding between 0-1?

Open blldd opened this issue 6 years ago • 4 comments

Hi, i have got some problem when i want to get embedding between 0 and 1, even when i initialize between 0 and 1, it doesn't work, how should i do?

blldd avatar Aug 10 '18 12:08 blldd

What do you mean by saying "get embedding between 0 and 1"? Do you mean some kind of normalization? The embedding are normalized so that the L2 norm of all the embedding vectors are equal to 1 (so all elements of the embedding vector are between -1 and 1).

snowkylin avatar Aug 10 '18 13:08 snowkylin

cause i don't want get negative number in embedding, so how can i get normalization between 0 and 1,Thank you :)

blldd avatar Aug 10 '18 13:08 blldd

It is not so reasonable to normalize the embedding between 0 and 1 when the mechanism of embedding is considered. However, if you really need that, some simple linear transformation like f(x) = (x + 1)/2 can make it.

snowkylin avatar Aug 10 '18 13:08 snowkylin

Thank you for your explanation and suggestion:)

blldd avatar Aug 10 '18 13:08 blldd