48 using namespace Eigen;
53 CKLLowerTriangularInference::CKLLowerTriangularInference() :
CKLInference()
65 void CKLLowerTriangularInference::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)",
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]);
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;
160 MatrixXd tmp1=eigen_InvK_Sigma+eigen_alpha*(eigen_mu.transpose());
163 return 0.5*(tmp3.array()*eigen_dK.array()).sum();
SGMatrix< float64_t > m_Kernel_LsD
virtual ~CKLLowerTriangularInference()
virtual void update_deriv()
SGVector< float64_t > m_mean_vec
The class Labels models labels, i.e. class assignments of objects.
virtual SGVector< float64_t > get_mean_vector(const CFeatures *features) const =0
An abstract class of the mean function.
virtual void update_InvK_Sigma()=0
virtual Eigen::LDLT< Eigen::MatrixXd, 0x1 > update_init_helper()
SGMatrix< float64_t > m_ktrtr
virtual float64_t get_derivative_related_cov(SGMatrix< float64_t > dK)
The KL approximation inference method class.
virtual void update_init()
CKLLowerTriangularInference()
SGVector< float64_t > m_mu
SGMatrix< float64_t > m_L
Eigen::MatrixXd solve_inverse(Eigen::MatrixXd A)
virtual void update_approx_cov()
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
SGVector< T > clone() const
virtual void update_chol()
virtual SGVector< float64_t > get_diagonal_vector()
SGVector< index_t > m_Kernel_P
SGMatrix< float64_t > m_InvK_Sigma
float64_t m_log_det_Kernel
virtual void update_Sigma()=0
The Likelihood model base class.
SGVector< float64_t > m_alpha