Browse Source

minor clean-up

Alexander Freytag 9 years ago
parent
commit
dfc5e04b6e
2 changed files with 7 additions and 6 deletions
  1. 2 2
      FMKGPHyperparameterOptimization.cpp
  2. 5 4
      GPHIKRawClassifier.cpp

+ 2 - 2
FMKGPHyperparameterOptimization.cpp

@@ -602,7 +602,7 @@ void FMKGPHyperparameterOptimization::initFromConfig ( const Config *_conf,
   // this->eig = new EigValuesTRLAN();
   // this->eig = new EigValuesTRLAN();
   // My time measurements show that both methods use equal time, a comparision
   // My time measurements show that both methods use equal time, a comparision
   // of their numerical performance has not been done yet  
   // of their numerical performance has not been done yet  
-  this->eig = new EVArnoldi ( _conf->gB ( _confSection, "eig_verbose", false ) /* verbose flag */, 10 );
+  this->eig = new EVArnoldi ( _conf->gB ( _confSection, "eig_verbose", false ) /* verbose flag */, 10 /*_maxiterations*/);
 
 
   this->nrOfEigenvaluesToConsider = std::max ( 1, _conf->gI ( _confSection, "nrOfEigenvaluesToConsider", 1 ) );
   this->nrOfEigenvaluesToConsider = std::max ( 1, _conf->gI ( _confSection, "nrOfEigenvaluesToConsider", 1 ) );
   
   
@@ -2064,7 +2064,7 @@ void FMKGPHyperparameterOptimization::restore ( std::istream & _is,
         //TODO eig
         //TODO eig
         // currently hard coded, since EV does not offer Persistent functionalities and 
         // currently hard coded, since EV does not offer Persistent functionalities and 
         // in addition, we currently have no other choice for EV then EVArnoldi
         // in addition, we currently have no other choice for EV then EVArnoldi
-        this->eig = new EVArnoldi ( false /*eig_verbose */, 10 );        
+        this->eig = new EVArnoldi ( false /*eig_verbose */, 10 /*_maxiterations*/ );
         _is >> tmp; // end of block 
         _is >> tmp; // end of block 
         tmp = this->removeEndTag ( tmp );
         tmp = this->removeEndTag ( tmp );
       }     
       }     

+ 5 - 4
GPHIKRawClassifier.cpp

@@ -310,8 +310,9 @@ void GPHIKRawClassifier::classify ( const NICE::SparseVector * _xstar,
         for ( std::map<uint, PrecomputedType>::const_iterator i = this->precomputedA.begin() ; i != this->precomputedA.end(); i++ )
         for ( std::map<uint, PrecomputedType>::const_iterator i = this->precomputedA.begin() ; i != this->precomputedA.end(); i++ )
         {
         {
           uint classno = i->first;
           uint classno = i->first;
-          maxClassNo = std::max ( maxClassNo, classno );
-          double beta = 0;
+          maxClassNo   = std::max ( maxClassNo, classno );
+          double beta  = 0;
+
           GMHIKernelRaw::sparseVectorElement **dataMatrix = gm->getDataMatrix();
           GMHIKernelRaw::sparseVectorElement **dataMatrix = gm->getDataMatrix();
 
 
           const PrecomputedType & A = i->second;
           const PrecomputedType & A = i->second;
@@ -320,11 +321,11 @@ void GPHIKRawClassifier::classify ( const NICE::SparseVector * _xstar,
 
 
           for (SparseVector::const_iterator i = _xstar->begin(); i != _xstar->end(); i++)
           for (SparseVector::const_iterator i = _xstar->begin(); i != _xstar->end(); i++)
           {
           {
-            uint dim = i->first;
+            uint dim    = i->first;
             double fval = i->second;
             double fval = i->second;
 
 
             uint nnz = this->nnz_per_dimension[dim];
             uint nnz = this->nnz_per_dimension[dim];
-            uint nz = this->num_examples - nnz;
+            uint nz  = this->num_examples - nnz;
 
 
             if ( nnz == 0 ) continue;
             if ( nnz == 0 ) continue;
             // useful
             // useful