Эх сурвалжийг харах

fixed bug in cloning function of ConvolutionalFeature

Sven Sickert 10 жил өмнө
parent
commit
b997d89422

+ 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;
 }