Step 4:
This
step is not strictly necessary, but it makes life a bit easier to
create two useful functions, one for the logistic sigmoid activation
function and one for the softmax activation function.
These are two very simple functions, each of which should be saved separately to be used later.
Lets call the logistic sigmoid function "sigmoid". Here is the full program:
function y=sigmoid(v)
y=1./(1+exp(-v));
That's the whole function! Save it as "sigmoid" for later use.
The second function creates the softmax activation function.
function y=softmax(v)
ex=exp(v);
y=ex./ sum(ex);
That's also the whole function. Save it as "softmax" for later use.
After you create these two "side" functions. Go back to the program MultiClass to complete that function.