Fixed compute_lda_transform() so it works properly when the class covariance

matrices are singular even after performing PCA.
This commit is contained in:
Davis King 2015-01-10 11:53:29 -05:00
parent c24c11f662
commit 298d3a4a56

View File

@ -120,7 +120,7 @@ namespace dlib
matrix<T,0,1> W;
svd3(Sw, A, W, H);
W = sqrt(W);
W = reciprocal(round_zeros(W,max(W)*1e-5));
W = reciprocal(lowerbound(W,max(W)*1e-5));
A = trans(H*diagm(W))*Sb*H*diagm(W);
matrix<T> v,s,u;
svd3(A, v, s, u);