48 using namespace Eigen;
65 void CKLLowerTriangularInferenceMethod::init()
71 "The mean vector generated from mean function",
74 "The Log-determinant of Kernel",
78 "The L*sqrt(D) matrix, where L and D are defined in LDLT factorization on Kernel*sq(m_scale)",
81 "The permutation sequence of P, where P are defined in LDLT factorization on Kernel*sq(m_scale)",
108 MatrixXd Kernel_D=ldlt.vectorD();
109 MatrixXd Kernel_L=ldlt.matrixL();
113 eigen_Kernel_LsD.triangularView<Lower>()=Kernel_L*Kernel_D.array().sqrt().matrix().asDiagonal();
120 eigen_Kernel_P=ldlt.transpositionsP()*eigen_Kernel_P;
138 P.applyTranspositionOnTheLeft(i,tmp[i]);
146 MatrixXd tmp1=P*eigen_A;
147 MatrixXd tmp2=eigen_Kernel_LsD.triangularView<Lower>().solve(tmp1);
148 MatrixXd tmp3=eigen_Kernel_LsD.triangularView<Lower>().transpose().solve(tmp2);
149 return P.transpose()*tmp3;
159 MatrixXd tmp1=eigen_InvK_Sigma+eigen_alpha*(eigen_mu.transpose());
162 return 0.5*(tmp3.array()*eigen_dK.array()).sum();
SGMatrix< float64_t > m_Kernel_LsD
SGVector< float64_t > m_alpha
The class Labels models labels, i.e. class assignments of objects.
virtual void update_InvK_Sigma()=0
SGVector< index_t > m_Kernel_P
virtual ~CKLLowerTriangularInferenceMethod()
virtual SGVector< float64_t > get_mean_vector(const CFeatures *features) const =0
CKLLowerTriangularInferenceMethod()
Eigen::MatrixXd solve_inverse(Eigen::MatrixXd A)
An abstract class of the mean function.
virtual SGVector< float64_t > get_diagonal_vector()
SGMatrix< float64_t > m_L
virtual void update_deriv()
virtual void update_init()
virtual void update_chol()
SGVector< T > clone() const
virtual float64_t get_derivative_related_cov(Eigen::MatrixXd eigen_dK)
virtual Eigen::LDLT< Eigen::MatrixXd > update_init_helper()
The KL approximation inference method class.
The class Features is the base class of all feature objects.
SGVector< float64_t > m_mu
SGMatrix< float64_t > m_InvK_Sigma
virtual void update_Sigma()=0
SGVector< float64_t > m_mean_vec
float64_t m_log_det_Kernel
The Likelihood model base class.
SGMatrix< float64_t > m_ktrtr
virtual void update_approx_cov()