/ concept-collection / walnuts-interactive
Sign in
concept-collection / walnuts-interactive
walnuts-interactive / helpers / log_softmax.m
4 lines · 131 BCodeBlameHistory
cccc996Use Nawaf Bou-Rabee's reference WALNUTS implementationJeremy Magland 1function s = log_softmax(x)
2%LOG_SOFTMAX x - logsumexp(x); exp(log_softmax(x)) is a probability vector.
3s = x - logsumexp(x);
4end
moveopenescclose