clear all;
close all;

randn(seed,138);
cc=randn(3,2);
randn(seed,534);
uu=randn(2,3);

figure;
for x1=0:0.01:1
  for x2=0:0.01:1
    %layer 1 tasks
    y=rlines(cc,[x1;x2]);

    %layer 2 tasks
    z=renhance(uu,y);

    %layer 3 tasks
    [p1 p2] = sftmxcal(z);

    if(p1>p2)
      aa=.;
    else
      aa=r.;
    end
    plot(x1,x2,aa);hold on;
  end
end
xlabel(Feature 1);ylabel(Feature 2);


%% functoin

function [y] = rlines(cc,xx)
  y = cc*xx;
end

function [z] = renhance(uu,y)
  z=uu*y+0.03*rand(2,1);
end

function [p1 p2] = sftmxcal(z)
  p1=exp(z(1))/(exp(z(1))+exp(z(2)));
  p2=exp(z(2))/(exp(z(1))+exp(z(2)));
end