function net_2 = NeuralNetBackpropOutput(w_1,w_2,xvec) % Calculate output of 2-layer network. % % By: Neil E. Cotter % 11/03/2010 % % Sigmoidal 2-layer neural net. % Output neuron is linear (no squasher). N = size(w_1,1); % Calculate the neuron outputs for 1st layer. for neuron_index = 1:N % Calculate weights * inputs. net_1(neuron_index) = w_1(neuron_index, :) * xvec'; % Calculate output of 1st-layer neuron. o_1(neuron_index) = 1/(1 + exp(-net_1(neuron_index))); end % Calculate output of output neuron. net_2 = w_2 * [1, o_1]';