Commit 298d3a4a authored by Davis King's avatar Davis King

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

matrices are singular even after performing PCA.
parent c24c11f6
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment