You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
150 B
Matlab

function s=measure_sparsity_hoyer(y)
[n,p]=size(y);
sqrtn=sqrt(n);
for i=1:p
s(i)=(sqrtn-(norm(y(:,i),1)/norm(y(:,i),2)))/(sqrtn-1);
end
s=mean(s);