fix inintial weighting
authormarina.kolpakova <marina.kolpakova@itseez.com>
Thu, 13 Dec 2012 10:31:28 +0000 (14:31 +0400)
committermarina.kolpakova <marina.kolpakova@itseez.com>
Fri, 1 Feb 2013 10:34:39 +0000 (14:34 +0400)
apps/sft/octave.cpp

index e886fbd..6a02d54 100644 (file)
@@ -382,8 +382,8 @@ void sft::Octave::write( cv::FileStorage &fso, const Mat& thresholds) const
 void sft::Octave::initial_weights(double (&p)[2])
 {
     double n = data->sample_count;
-    p[0] =  n / (double)(nnegatives) ;
-    p[1] =  n / (double)(npositives);
+    p[0] =  n / (2. * (double)(nnegatives));
+    p[1] =  n / (2. * (double)(npositives));
 }
 
 bool sft::Octave::train(const Dataset& dataset, const FeaturePool& pool, int weaks, int treeDepth)