Merge pull request #322 from cuda-geek:training

This commit is contained in:
cuda-geek
2013-02-01 18:45:12 +04:00
committed by OpenCV Buildbot
46 changed files with 65063 additions and 299 deletions
+2 -1
View File
@@ -1251,6 +1251,8 @@ protected:
virtual void write_params( CvFileStorage* fs ) const;
virtual void read_params( CvFileStorage* fs, CvFileNode* node );
virtual void initialize_weights(double (&p)[2]);
CvDTreeTrainData* data;
CvBoostParams params;
CvSeq* weak;
@@ -2129,7 +2131,6 @@ typedef CvGBTrees GradientBoostingTrees;
template<> CV_EXPORTS void Ptr<CvDTreeSplit>::delete_obj();
CV_EXPORTS bool initModule_ml(void);
}
#endif // __cplusplus
+9 -3
View File
@@ -879,7 +879,6 @@ void CvBoostTree::read( CvFileStorage* fs, CvFileNode* fnode, CvBoost* _ensemble
ensemble = _ensemble;
}
void CvBoostTree::read( CvFileStorage*, CvFileNode* )
{
assert(0);
@@ -1116,6 +1115,12 @@ bool CvBoost::train( CvMLData* _data,
return result;
}
void CvBoost::initialize_weights(double (&p)[2])
{
p[0] = 1.;
p[1] = 1.;
}
void
CvBoost::update_weights( CvBoostTree* tree )
{
@@ -1159,8 +1164,9 @@ CvBoost::update_weights( CvBoostTree* tree )
// in case of logitboost and gentle adaboost each weak tree is a regression tree,
// so we need to convert class labels to floating-point values
double w0 = 1./n;
double p[2] = { 1, 1 };
double w0 = 1./ n;
double p[2] = { 1., 1. };
initialize_weights(p);
cvReleaseMat( &orig_response );
cvReleaseMat( &sum_response );