% Load W1 and W2
load mlpxor.mat

point_n = 31;
x = linspace(-1, 1, point_n); 
y = linspace(-1, 1, point_n); 
[xx, yy] = meshgrid(x, y);
X0 = [xx(:) yy(:)];
data_n = size(X0, 1);
one = ones(data_n, 1);

X1 = tanh([X0 one]*W1);	% Output of layer 1 (hidden layer)
X2 = tanh([X1 one]*W2);	% Output of layer 2 (output layer)

zz = reshape(X2, point_n, point_n);
pcolor(xx, yy, zz);
axis image
colormap(gray);
shading interp

