function fit=myFitnessPerceptron(w)

global x
global d

y = x*w' > 0;
fit = sum((d-y).^2);