123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- /**
- * @file ConvolutionFeature.h
- * @brief convolutional feature
- * @author Sven Sickert
- * @date 10/13/2008
- */
- #ifndef ConvolutionFeatureINCLUDE
- #define ConvolutionFeatureINCLUDE
- #include "core/vector/VectorT.h"
- #include "core/vector/MatrixT.h"
- #include "core/basics/Config.h"
- #include "vislearning/cbaselib/Feature.h"
- namespace OBJREC{
- /** convolutional feature */
- class ConvolutionFeature : public Feature
- {
- protected:
- /////////////////////////
- /////////////////////////
- // PROTECTED VARIABLES //
- /////////////////////////
- /////////////////////////
- /** feature parameter */
- int window_size_x;
- int window_size_y;
- int beta_length;
- NICE::Vector *beta;
- public:
- ///////////////////// ///////////////////// /////////////////////
- // CONSTRUCTORS / DESTRUCTORS
- ///////////////////// ///////////////////// /////////////////////
- /** simple constructor */
- ConvolutionFeature ( );
- /** default constructor */
- ConvolutionFeature ( const NICE::Config *conf );
- /** simple destructor */
- virtual ~ConvolutionFeature ( );
- ///////////////////// ///////////////////// /////////////////////
- // FEATURE STUFF
- ///////////////////// ///////////////////// /////////////////////
- /**
- * @brief (re)initialize parameter vector
- */
- void initializeParameterVector();
- /**
- * @brief return parameter vector
- * @return parameter vector
- */
- NICE::Vector getParameterVector () const;
- /**
- * @brief return feature vector
- * @param example current example
- * @return feature vector
- */
- NICE::Vector getFeatureVector ( const Example *example );
- /**
- * @brief return length of parameter vector
- * @return length of vector
- */
- int getParameterLength () const;
- /**
- * @brief set parameter vector
- * @param vec new parameter vector
- */
- void setParameterVector ( const NICE::Vector &vec );
- /**
- * @brief return feature value for given example
- * @param example given Example
- * @return double feature value
- */
- double val ( const Example *example ) const;
- /**
- * @brief create feature pool with convolutional features
- * @param featurePool to be filled
- * @param variableWindow
- */
- void explode ( FeaturePool &featurePool, bool variableWindow = true ) const;
- /**
- * @brief clone current feature
- * @return clone of current feature
- */
- Feature *clone () const;
- Feature *generateFirstParameter () const;
- ///////////////////// INTERFACE PERSISTENT /////////////////////
- // interface specific methods for store and restore
- ///////////////////// INTERFACE PERSISTENT /////////////////////
- /**
- * @brief Load convolution feature object from external file (stream)
- */
- virtual void restore ( std::istream & is, int format = 0 );
- /**
- * @brief Save convolution feature object to external file (stream)
- */
- virtual void store( std::ostream & os, int format = 0 ) const;
- /**
- * @brief Clear convolution feature object
- */
- virtual void clear ();
- };
- } //namespace
- #endif
|