|
@@ -6,6 +6,7 @@
|
|
|
|
|
|
*/
|
|
|
#include <iostream>
|
|
|
+#include <time.h>
|
|
|
|
|
|
#include "ConvolutionFeature.h"
|
|
|
#include "vislearning/cbaselib/FeaturePool.h"
|
|
@@ -169,6 +170,18 @@ int ConvolutionFeature::getParameterLength() const
|
|
|
return betaLength;
|
|
|
}
|
|
|
|
|
|
+void ConvolutionFeature::setRandomParameterVector ( )
|
|
|
+{
|
|
|
+ srand (time(NULL));
|
|
|
+ for ( NICE::Vector::iterator it = beta->begin();
|
|
|
+ it != beta->end(); ++it )
|
|
|
+ {
|
|
|
+ double b = (double) rand() / (double) RAND_MAX;
|
|
|
+ *it = b;
|
|
|
+ }
|
|
|
+ beta->normalizeL2();
|
|
|
+}
|
|
|
+
|
|
|
/** set parameter vector */
|
|
|
void ConvolutionFeature::setParameterVector( const Vector & vec )
|
|
|
{
|