Hi, I'm working on a paper, after reading the word2vec.c code, it looks like the CBOW "gradient of loss" is calculated in:
f = expTable[(int)((f + MAX_EXP) * (EXP_TABLE_SIZE / MAX_EXP / 2))];
g = (1 - vocab[word].code[d] - f) * alpha; // 'g' is the gradient multiplied by the learning rate
I want to be able to get the loss of an input and not the gradient of it, is there anyway to get that? is there any function that does so?
thanks for sharing