function a_k = evaluate(a_n)
%  EVALUATE  Implements a standard forward propagation.
%  EVALUATE(A_N), where A_N is the input vector, performs a standard forward
%  propagation according the rules below and returns the output vector.
%
%  a_h = map( sigma(x), w_1 x a_n )
%  a_k = map( sigma(x), w_2 x a_h )
%
%  THIS FUNCTION UPDATES GLOBAL VARIABLES.


global A_H W1 W2;


A_H = sigma(W1 * a_n);
A_H(end, 1) = 1;            % Reset the bias node to 1
a_k = sigma(W2 * A_H);
