I think there is a calculation error:

exp(-5) = 0.0067379469990855 and 1/32 = 0,03125

Question:

What if it happens that x’ = (0,0,0)? Is that even possible? Does that mean I have to tweak my weights through learning?

Thanks again

Akin C.

(Sorry if I posted the comment twice)

for (int i = 0; i a)

a = xs[i];

did you mean to type:

double a = Double.NEGATIVE_INFINITY;

or am I missing a point? it seems the above codeblock sets all ‘a’-s to max_double then keeps it that way.

I’ll see what I can do about fixing the old links. They luckily have the raw LaTeX still in the anchor tag.

]]>function s=logsumexp(x)

y=max(x);

s=y+log(sum(exp(x-y)));

Then the sofmax(x) is smply:

exp(x-logsumexp(x));

Which seems easier.

Have fun:)