function s=scoreNCE(c,y,k)
% score the assignments against the data
[n,d]=size(y);
for i=1:k,
for j=1:d,
    qq(:,j)=(y(:,j)-c(i,j)).^d;
end    
    nn(:,i)=(sum(qq,2)).^(1/d);
end
mm=min(nn,[],2);
s=sum(mm);% Score the assignment
