123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- #ifndef FPCBoostingINCLUDE
- #define FPCBoostingINCLUDE
- #include "core/vector/VectorT.h"
- #include "core/vector/MatrixT.h"
- #include "core/basics/Config.h"
- #include "vislearning/classifier/classifierbase/FeaturePoolClassifier.h"
- #include "vislearning/cbaselib/FeaturePool.h"
- #include "core/basics/triplet.h"
- namespace OBJREC
- {
- class StrongClassifier : public std::vector< NICE::triplet<double, double, FeaturePoolClassifier *> >
- {};
- class FPCBoosting : public FeaturePoolClassifier
- {
- protected:
- const NICE::Config *conf;
-
- bool classwise_normalization;
-
- int boosting_method;
-
- int positive_class;
-
- int maxRounds;
-
- bool memory_efficient;
-
- FeaturePoolClassifier *weakClassifier;
-
- StrongClassifier strongClassifier;
-
- void boosting ( const FeatureStorage & featureStorage,
- FeaturePool & fp,
- Examples & examples );
-
- void normalizeWeights ( Examples & examples ) const;
- public:
- enum
- {
- BOOSTINGMETHOD_ADABOOST = 0,
- BOOSTINGMETHOD_REAL_ADABOOST,
- BOOSTINGMETHOD_GENTLEBOOST
- };
-
- FPCBoosting() {};
-
- FPCBoosting ( const NICE::Config *conf,
-
-
- std::string section = "Boost" );
-
- virtual ~FPCBoosting();
-
- ClassificationResult classify ( Example & pce );
-
- virtual void train ( FeaturePool & fp,
- Examples & examples );
-
- void restore ( std::istream & is, int format = 0 );
- void store ( std::ostream & os, int format = 0 ) const;
- void clear ();
-
-
- FeaturePoolClassifier *clone () const;
-
- StrongClassifier & getStrongClassifier ()
- {
- return strongClassifier;
- };
-
- void setComplexity ( int size );
- };
- }
- #endif
|