function Display2(M,res,nit,w1,w2,layer_size,x,t)
tp=t*0;
tp=t*0;
layer_num=numel(layer_size); %layer number include the input and output

for m=1:M
      a0=x(:,m);
      z1=w1'*a0;
      g1=1./(1+exp(-z1));
      a1=g1;
      z2=w2'*a1;
      g2=1/(1+exp(-z2));
      a2=g2;
      tp(m)=a2;
end

titleNN=[];
for iter =1:layer_num %%%----- N (in book) ------%%%
titleNN=[titleNN,' ',num2str(layer_size(iter))];
end

subplot(121);plot(res(2:nit));
ylabel('Avg Misfit');xlabel('Iteration #')
title({[ 'a) 2-Node: # of In+hide+out Layers =',num2str(layer_num)];...
    ['NN Architecture =  [',titleNN,']']});
subplot(122);plot([1:M],t,'r*',[1:M],tp,'g*')
ylabel(' Example Class');xlabel('Example #')
title({['b) Obs. (red) vs Pred. (green) Classes'];...
    [ 'NN Architecture = [',titleNN,']']});