mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Fixed compute_lda_transform() so it works properly when the class covariance
matrices are singular even after performing PCA.
This commit is contained in:
parent
c24c11f662
commit
298d3a4a56
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user