37 #ifndef SHARK_ALGORITHMS_TRAINERS_NORMALIZECOMPONENTSZCA_H 38 #define SHARK_ALGORITHMS_TRAINERS_NORMALIZECOMPONENTSZCA_H 62 m_targetVariance = targetVariance;
67 {
return "NormalizeComponentsZCA"; }
78 meanvar(input, mean, covariance);
80 blas::symm_eigenvalue_decomposition<RealMatrix> eigen(covariance);
81 covariance=RealMatrix();
84 RealMatrix ZCAMatrix = eigen.Q() % to_diagonal(elem_inv(sqrt(eigen.D()))) % trans(eigen.Q());
85 ZCAMatrix *= std::sqrt(m_targetVariance);
87 RealVector offset = -prod(ZCAMatrix,mean);