function net = simple_mlp_create(nneur)
% Creates a default network with random weights.
% You may alter the structure later to customize it.
% Note: Include input layer size in nneur!
%
% An illustration when nneur==[2 3 2 2]:
%  ______________________
%        o
% ->o         o    o  -->
%        o
% ->o         o    o  -->
%        o
%  In   Hid1 Hid2  Out
% ______________________

lastL = numel(nneur)-1;  % Expect input dimension to be nneur(1).

%% Random weights
for i=1:lastL
  W{i} = -1 + 2*rand(nneur(i+1),nneur(i)+1);
end;

%% Prepare the activation funcs; by default, tanh on hidden, linear on out
for L = 1:lastL-1;
  activ{L} = @simple_mlp_tanhfwd;
  activD{L} = @simple_mlp_tanhderiv;
end
activ{lastL} = @simple_mlp_plinfwd;
activD{lastL} = @simple_mlp_plinderiv;


%% Put the things into the structure to be returned:
net.nneur = nneur;
net.W = W;
net.activ = activ;
net.activD = activD;
net.regc = 0.0;
