apply_lrds - applies the classifier Syntax: out = apply_lrds(X, cls)
0001 function out = apply_lrds(X, cls) 0002 % apply_lrds - applies the classifier 0003 % 0004 % Syntax: 0005 % out = apply_lrds(X, cls) 0006 0007 [C1, C2, n] = size(X); 0008 0009 if C1==1 0010 C = sqrt(C2); 0011 X = shiftdim(X); 0012 elseif C1~=C2 0013 error('Input is not square.'); 0014 else 0015 C = C1; 0016 X = reshape(X, [C^2, n]); 0017 end 0018 0019 out = reshape(cls.Ww*cls.W*cls.Ww', [1,C^2])*X + cls.bias;