Ejemplo n.º 1
0
//#include "countLine.h"
int main(int argc, char** argv)
{

	ComputeKernelMatrix(argc, argv);

	// step 7. train and test with svm.
	//TrainAndTest(argc, argv);
	
	// extra. count the lines of files extracted by step 2.
	//countLine(argc, argv);	
	return 0;
}
Ejemplo n.º 2
0
void GaussianProcess<TScalarType>::ComputeCoreMatrix(typename GaussianProcess<TScalarType>::MatrixType &C) const{
    MatrixType K;
    ComputeKernelMatrix(K);

    // add noise variance to diagonal
    AddNoiseToKernelMatrix(K);

    C = InvertKernelMatrix(K, m_InvMethod);

    if(debug){
        std::cout << "GaussianProcess::ComputeCoreMatrix: inversion error: " << (K*C - MatrixType::Identity(K.rows(),K.cols())).norm() << std::endl;
    }
}
Ejemplo n.º 3
0
typename GaussianProcess<TScalarType>::HighPrecisionType GaussianProcess<TScalarType>::ComputeCoreMatrixWithDeterminant(typename GaussianProcess<TScalarType>::MatrixType &C) const{
    typedef typename GaussianProcess<TScalarType>::HighPrecisionType HighPrecisionType;
    MatrixType K;
    ComputeKernelMatrix(K);

    // add noise variance to diagonal
    AddNoiseToKernelMatrix(K);

    C = InvertKernelMatrix(K, m_InvMethod);

    if(debug){
        std::cout << "GaussianProcess::ComputeCoreMatrix: inversion error: " << (K*C - MatrixType::Identity(K.rows(),K.cols())).norm() << std::endl;
        std::cout << "GaussianProcess::ComputeCoreMatrix: determinant of K: " << K.template cast<HighPrecisionType>().determinant() << std::endl;
    }
    return K.template cast<HighPrecisionType>().determinant();
}