Browse Source

clean-up of debug statements

Alexander Freytag 9 năm trước cách đây
mục cha
commit
0fb3176100

+ 2 - 19
FMKGPHyperparameterOptimization.cpp

@@ -673,16 +673,6 @@ void FMKGPHyperparameterOptimization::setFastMinKernel ( FastMinKernel * _fmk )
   if ( this->q != NULL )
   {  
     this->q->computeParametersFromData ( &(this->fmk->featureMatrix()) );
-    
-//     if ( this->b_debug )
-//     {
-      std::cerr << "resulting prototypes for first dimension: " << std::endl;
-      for ( uint idxProto = 0; idxProto < this->q->getNumberOfBins(); idxProto++)
-      {
-        std::cerr << this->q->getPrototype ( idxProto, 0 ) << " ";
-      }
-      std::cerr << std::endl;
-//     }
   }
 }
 
@@ -1189,8 +1179,6 @@ uint FMKGPHyperparameterOptimization::classify ( const NICE::SparseVector & _xst
     _scores[ classno ] = beta;
   }
   _scores.setDim ( maxClassNo + 1 );
-  std::cerr << "_scores : " << std::endl;
-  _scores.store ( std::cerr ) ;
   
   if ( this->precomputedA.size() > 1 )
   { // multi-class classification
@@ -1198,7 +1186,6 @@ uint FMKGPHyperparameterOptimization::classify ( const NICE::SparseVector & _xst
   }
   else if ( this->knownClasses.size() == 2 ) // binary setting
   {      
-    std::cerr << "i_binaryLabelNegative: " << i_binaryLabelNegative << " i_binaryLabelPositive: " << i_binaryLabelPositive<< std::endl;
     _scores[ this->i_binaryLabelNegative ] = -_scores[ this->i_binaryLabelPositive ];     
     return _scores[ this->i_binaryLabelPositive ] <= 0.0 ? this->i_binaryLabelNegative : this->i_binaryLabelPositive;
   }
@@ -1317,11 +1304,7 @@ void FMKGPHyperparameterOptimization::computePredictiveVarianceApproximateRough
 void FMKGPHyperparameterOptimization::computePredictiveVarianceApproximateFine ( const NICE::SparseVector & _x, 
                                                                                  double & _predVariance 
                                                                                ) const
-{
-  
-  std::cerr << " security check! " << std::endl;
-  std::cerr << "b_debug: " << this->b_debug << std::endl;
-  
+{  
   if ( this->b_debug )
   {
     std::cerr << "FMKGPHyperparameterOptimization::computePredictiveVarianceApproximateFine" << std::endl;
@@ -1676,7 +1659,7 @@ void FMKGPHyperparameterOptimization::restore ( std::istream & _is,
   if ( _is.good() )
   {
     if ( b_restoreVerbose ) 
-      std::cerr << " in FMKGP restore" << std::endl;
+      std::cerr << " in FMKGPHyperparameterOptimization restore" << std::endl;
     
     std::string tmp;
     _is >> tmp; //class name 

+ 0 - 6
FastMinKernel.cpp

@@ -347,12 +347,6 @@ double *FastMinKernel::hik_prepare_alpha_multiplications_fast(const NICE::VVecto
   }
 
   delete [] prototypes;
-  
-  double * Tval = Tlookup;
-  std::cerr << " computed LUT " << std::endl;
-  for ( uint idx = 0 ; idx < hmax * this->ui_d; idx++, Tval++ )
-    std::cerr << " " << *Tval ;
-  std::cerr << std::endl;
 
   return Tlookup;
 }

+ 2 - 11
FeatureMatrixT.tcc

@@ -509,22 +509,18 @@ namespace NICE {
       T vmax = (T) 0; 
       T vtmp = (T) 0;
       
-      std::cerr << " FeatureMatrixT<T>::getLargestValue begin of for loop " << std::endl;
       uint tmp ( 0 );
       for ( typename std::vector<NICE::SortedVectorSparse<T> >::const_iterator it = this->features.begin();
             it != this->features.end();
             it++, tmp++
       )
       {
-        std::cerr << " dim: " << tmp << std::endl;
         vtmp = it->getLargestValueUnsafe( 1.0 /*quantile, we are interested in the largest value*/, _getTransformedValue );
-        std:: cerr << "largest value: " << vtmp << std::endl;
         if ( vtmp > vmax )
         {
           vmax = vtmp;
         }
       }
-      std::cerr << " FeatureMatrixT<T>::getLargestValue end of for loop -- largest value: " << vmax << std::endl;
       return vmax;
     }
     
@@ -535,20 +531,15 @@ namespace NICE {
     {
       NICE::VectorT<T> vmax ( this->get_d() );
       
-      std::cerr << " FeatureMatrixT<T>::getLargestValuePerDimension begin of for loop " << std::endl;      
-      
       uint tmp ( 0 );      
       typename NICE::VectorT<T>::iterator vmaxIt = vmax.begin();
       for ( typename std::vector<NICE::SortedVectorSparse<T> >::const_iterator it = this->features.begin();
             it != this->features.end();
             it++, vmaxIt++, tmp++
       )
-      {
-        std::cerr << " dim: " << tmp << std::endl;        
+      {       
         *vmaxIt = it->getLargestValueUnsafe( _quantile, _getTransformedValue );
-        std:: cerr << "largest value: " << *vmaxIt << std::endl;
-      }      
-      std::cerr << " FeatureMatrixT<T>::getLargestValuePerDimension end of for loop " << std::endl;     
+      }    
       return vmax;
     }
     

+ 2 - 12
SortedVectorSparse.h

@@ -264,22 +264,17 @@ template<class T> class SortedVectorSparse : NICE::Persistent{
         
         if ( _quantile > 0.5 )
         {
-          std::cerr << " getLargestTransformedValueUnsafe -- _quantile > 0.5 " << std::endl;
           typename std::multimap< T, dataelement >::const_reverse_iterator it = this->nzData.rend();
           
           //
           // take as many backward steps as indicated by _quantile
           for ( uint idx = this->getNonZeros(); idx > idxDest; idx-- )
           {
-            std::cerr << " idx: " << idx ;
-            std::cerr << " value: " << it->second.second << std::endl;
             it++;
           }          
           // alternative usage for random access iterators:
           // it = it + (uint) this->getNonZeros() * ( 1.0 -  _quantile );
-          
-            std::cerr << " final idx: " << idxDest ;
-            std::cerr << " final value: " << it->second.second << std::endl;   
+
             if ( _getTransformedValue )
               return it->second.second;
             else
@@ -310,22 +305,17 @@ template<class T> class SortedVectorSparse : NICE::Persistent{
         
         if ( _quantile > 0.5 )
         {
-          std::cerr << " getLargestTransformedValueUnsafe -- _quantile > 0.5 " << std::endl;
           typename std::multimap< T, dataelement >::const_reverse_iterator it = this->nzData.rend();
           
           //
           // take as many backward steps as indicated by _quantile
           for ( uint idx = this->getNonZeros(); idx > idxDest; idx-- )
           {
-            std::cerr << " idx: " << idx ;
-            std::cerr << " value: " << it->second.second << std::endl;
             it++;
           }          
           // alternative usage for random access iterators:
           // it = it + (uint) this->getNonZeros() * ( 1.0 -  _quantile );
-          
-            std::cerr << " final idx: " << idxDest ;
-            std::cerr << " final value: " << it->second.second << std::endl;          
+     
           return it->second.second;
         }
         else

+ 1 - 4
quantization/Quantization1DAequiDist0ToMax.cpp

@@ -60,10 +60,7 @@ uint Quantization1DAequiDist0ToMax::quantize ( double _value,
 
 void Quantization1DAequiDist0ToMax::computeParametersFromData ( const NICE::FeatureMatrix *  _fm )
 {
-      std::cerr << " Quantization1DAequiDist0ToMax::computeParametersFromData start " << std::endl;  
-      double vmax = ( _fm->getLargestValue( ) ); 
-      
-      std::cerr << " largest feature value: " << vmax << std::endl;
+      double vmax = ( _fm->getLargestValue( ) );       
       this->v_upperBounds.resize ( 1 );
       this->v_upperBounds ( 0 ) = vmax;
 }

+ 0 - 2
quantization/QuantizationNDAequiDist0ToMax.cpp

@@ -57,9 +57,7 @@ void QuantizationNDAequiDist0ToMax::computeParametersFromData ( const NICE::Feat
 {     
   // 100% quantile...
   double d_quantile ( 1.00 ); 
-  std::cerr << "QuantizationNDAequiDist0ToMax::computeParametersFromData -- d_quantile: " << d_quantile << std::endl;
   this->v_upperBounds = _fm->getLargestValuePerDimension( d_quantile );  
-  std::cerr << " computed upper bounds: " <<  this->v_upperBounds << std::endl;
 }
 
 // ---------------------- STORE AND RESTORE FUNCTIONS ----------------------