Эх сурвалжийг харах

resolved usual stupid merge conflict

Alexander Luetz 13 жил өмнө
parent
commit
9e57579e10

+ 4 - 3
math/kernels/KernelData.cpp

@@ -47,11 +47,12 @@ KernelData::KernelData ( const KernelData & src )
   cr = src.cr->clone();
 }
 
-KernelData::KernelData ( const Config *conf, const Matrix & kernelMatrix, const string & section )
+KernelData::KernelData ( const Config *conf, const Matrix & kernelMatrix, const string & section, bool updateCholesky )
 {
   initFromConfig ( conf, section );
   this->kernelMatrix = kernelMatrix;
-  updateCholeskyFactorization();
+  if ( updateCholesky ) 
+    updateCholeskyFactorization();
 }
 
 KernelData::KernelData ( const Config *conf, const string & section )
@@ -826,4 +827,4 @@ void KernelData::increase_size_by_k ( const uint & k )
   //NOTE Maybe it would be more efficient to work directly with pointers to the memory
   choleskyMatrix.resize ( new_Kernel.rows(), new_Kernel.cols() );
   choleskyMatrix = new_Kernel;
-}
+}

+ 1 - 1
math/kernels/KernelData.h

@@ -61,7 +61,7 @@ class KernelData
 		KernelData( const NICE::Config *conf, const std::string & section = "Kernel" );
 		
 		/** the config contains information about numerical setting of the cholesky factorization etc. */
-		KernelData( const NICE::Config *conf, const NICE::Matrix & kernelMatrix, const std::string & section = "Kernel" );
+		KernelData( const NICE::Config *conf, const NICE::Matrix & kernelMatrix, const std::string & section = "Kernel", bool updateCholesky = true );
 		  
 		/** simple destructor */
 		virtual ~KernelData();

+ 1 - 2
progs/testImageNetBinaryBruteForce.cpp

@@ -231,8 +231,7 @@ KCMinimumEnclosingBall *trainSVDD( const double & noise, const NICE::Matrix kern
     Config conf;
     // set the outlier ratio (Paul optimized this paramter FIXME)
     conf.sD( "SVDD", "outlier_fraction", 0.1 );
-      
-    KCMinimumEnclosingBall *svdd = new KCMinimumEnclosingBall ( &conf, NULL /* no kernel function */, "SVDD" /* config section */ );
+    KCMinimumEnclosingBall *svdd = new KCMinimumEnclosingBall ( &conf, NULL /* no kernel function */, "SVDD" /* config section */, false /* update cholesky */ );
 
     KernelData kernelData ( &conf, kernelMatrix, "Kernel" );