diff --git a/src/shogun/CMakeLists.txt b/src/shogun/CMakeLists.txt index 31a0d2c7b..e700bd7c7 100644 --- a/src/shogun/CMakeLists.txt +++ b/src/shogun/CMakeLists.txt @@ -307,7 +307,7 @@ IF(NOT EIGEN3_FOUND) ) ELSE() # https://github.com/shogun-toolbox/shogun/issues/4870 - IF(${EIGEN3_VERSION_STRING} VERSION_GREATER 3.3.9) + IF(0) MESSAGE(FATAL_ERROR "The system Eigen3 version ${EIGEN3_VERSION_STRING} isn't supported!") ENDIF() SHOGUN_INCLUDE_DIRS(SCOPE PUBLIC SYSTEM ${EIGEN3_INCLUDE_DIR}) diff --git a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp index a1677177e..0c9ca8f78 100644 --- a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp +++ b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp @@ -87,10 +87,10 @@ public: float64_t result=0; for(index_t bl=0; blblock(bl * n, 0, n, 1) * std::exp(log_scale * 2.0); - result+=alpha->block(bl*n,0,n,1).dot(eigen_f.block(bl*n,0,n,1))/2.0; - eigen_f.block(bl*n,0,n,1)+=eigen_m; + eigen_f.segment(bl * n, n) = + K * alpha->segment(bl * n, n) * std::exp(log_scale * 2.0); + result+=alpha->segment(bl*n,n).dot(eigen_f.segment(bl*n,n))/2.0; + eigen_f.segment(bl*n,n)+=eigen_m; } // get first and second derivatives of log likelihood @@ -278,9 +278,9 @@ void MultiLaplaceInferenceMethod::update_alpha() { Map alpha(m_alpha.vector, m_alpha.vlen); for(index_t bl=0; bl chol_tmp( (eigen_sD * eigen_sD.transpose()) .cwiseProduct(eigen_ktrtr * std::exp(m_log_scale * 2.0)) + @@ -351,14 +351,14 @@ void MultiLaplaceInferenceMethod::update_alpha() VectorXd tmp2=m_tmp.array().rowwise().sum(); for(index_t bl=0; bl &eigen_c=eigen_W; for(index_t bl=0; bl c_tmp(eigen_c.data(),n,C); @@ -422,7 +422,7 @@ float64_t MultiLaplaceInferenceMethod::get_derivative_helper(SGMatrix { result+=((eigen_E.block(0,bl*n,n,n)-eigen_U.block(0,bl*n,n,n).transpose()*eigen_U.block(0,bl*n,n,n)).array() *eigen_dK.array()).sum(); - result-=(eigen_dK*eigen_alpha.block(bl*n,0,n,1)).dot(eigen_alpha.block(bl*n,0,n,1)); + result-=(eigen_dK*eigen_alpha.segment(bl*n,n)).dot(eigen_alpha.segment(bl*n,n)); } return result/2.0; @@ -504,7 +504,7 @@ SGVector MultiLaplaceInferenceMethod::get_derivative_wrt_mean( result[i]=0; //currently only compute the explicit term for(index_t bl=0; bl