Bladeren bron

minor comments

Erik Rodner 9 jaren geleden
bovenliggende
commit
baa60ce643
1 gewijzigde bestanden met toevoegingen van 12 en 1 verwijderingen
  1. 12 1
      FastMinKernel.cpp

+ 12 - 1
FastMinKernel.cpp

@@ -788,6 +788,11 @@ double *FastMinKernel::solveLin(const NICE::Vector & _y,
                                 bool _timeAnalysis
                                ) const
 {
+  // note: this is the optimization done in Wu10_AFD and a
+  // random version of it. In normal cases, IKMNoise should be
+  // used together with your iterative solver of choice
+  //
+
   uint sizeOfRandomSubset(_sizeOfRandomSubset);
 
   bool verboseMinimal ( false );
@@ -805,13 +810,14 @@ double *FastMinKernel::solveLin(const NICE::Vector & _y,
   double alpha_new;
   double x_i;
 
-  // initialization
+  // initialization of the alpha vector
   if (_alpha.size() != _y.size())
   {
     _alpha.resize( _y.size() );
   }
   _alpha.set(0.0);
 
+  // initialize the lookup table
   double *Tlookup = new double [ hmax * this->ui_d ];
   if ( (hmax*this->ui_d) <= 0 )
     return Tlookup;
@@ -825,6 +831,9 @@ double *FastMinKernel::solveLin(const NICE::Vector & _y,
 
   if (_useRandomSubsets)
   {
+    // FIXME: this code looks bogus, since we only iterate over a random
+    // permutation of the training examples (several random subsets), without
+    // during anything particular between batches
     std::vector<uint> indices( _y.size() );
     for (uint i = 0; i < _y.size(); i++)
       indices[i] = i;
@@ -900,6 +909,8 @@ double *FastMinKernel::solveLin(const NICE::Vector & _y,
   }
   else //don't use random subsets
   {
+    // this is the standard coordinate descent optimization
+    // in each of the elements in alpha
     for ( iter = 1; iter <= _maxIterations; iter++ )
     {