Преглед изворни кода

fixed bug in cloning function of ConvolutionalFeature

Sven Sickert пре 10 година
родитељ
комит
b997d89422
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      features/fpfeatures/ConvolutionFeature.cpp

+ 5 - 5
features/fpfeatures/ConvolutionFeature.cpp

@@ -191,10 +191,8 @@ double ConvolutionFeature::val ( const Example *example ) const
 /** creature feature pool */
 void ConvolutionFeature::explode ( FeaturePool &featurePool, bool variableWindow ) const
 {
-    ConvolutionFeature *f = new ConvolutionFeature();
-    f->window_size_x = window_size_x;
-    f->window_size_y = window_size_y;
-    f->initializeParameterVector();
+    ConvolutionFeature *f =
+            new ConvolutionFeature ( this->window_size_x, this->window_size_y );
 
     featurePool.addFeature(f);
 }
@@ -203,7 +201,9 @@ void ConvolutionFeature::explode ( FeaturePool &featurePool, bool variableWindow
 Feature *ConvolutionFeature::clone ( ) const
 {
     ConvolutionFeature *f =
-            new ConvolutionFeature ( *this );
+            new ConvolutionFeature ( this->window_size_x, this->window_size_y );
+
+    f->setParameterVector( *beta );
 
     return f;
 }