#include <TrainExamples.h>
|
| TrainExamples (const char *positivePaths, long double positiveWeight, const char *negativePaths, const char *negativeImages, int numberNegatives, vector< stumpRule > *cascade, VectorXf &tweaks, int layerCount, VectorXi *blackList, const char *toFile, bool trainMode, bool allInMemory) |
| constructor to use if you have enough memory More...
|
|
| ~TrainExamples () |
|
VectorXi * | calcEmpiricalError (vector< stumpRule > const *cascade, VectorXf &tweaks, int layerCount, float &falsePositive, float &detectionRate, bool hasReturn) |
| evaluate how the committee fares on a dataset More...
|
|
void | adaboost () |
| perform one round of adaboost More...
|
|
|
MatrixXf ** | sampleNegatives (int patchSize, vector< stumpRule > *cascade, VectorXf &tweaks, int layerCount, const char *negativeExamples, VectorXi *blackList) |
| get some extra negatives if necessary More...
|
|
bool | myStumpOrder (const stumpRule &one, const stumpRule &other) |
| what makes one stump better than the other More...
|
|
int | getExampleIndex (int featureIndex, int iterator) |
| return for an element pointed by iterator and featureIndex its exampleIndex More...
|
|
float | getExampleFeature (int featureIndex, int iterator) |
| return for an element pointed by iterator and featureIndex its example value More...
|
|
void | decisionStump (int featureIndex, stumpRule &best) |
| best stump given a feature More...
|
|
stumpRule | bestStump () |
| best stump among all features More...
|
|
void | predictLabel (float thresholdTweak, RowVectorXi &prediction, bool onlyMostRecent) |
| given a tweak and a committe, what prediction do you make as to the examples More...
|
|
Definition at line 54 of file TrainExamples.h.
TrainExamples::TrainExamples |
( |
const char * |
positivePaths, |
|
|
long double |
positiveWeight, |
|
|
const char * |
negativePaths, |
|
|
const char * |
negativeImages, |
|
|
int |
numberNegatives, |
|
|
vector< stumpRule > * |
cascade, |
|
|
VectorXf & |
tweaks, |
|
|
int |
layerCount, |
|
|
VectorXi * |
blackList, |
|
|
const char * |
toFile, |
|
|
bool |
trainMode, |
|
|
bool |
allInMemory |
|
) |
| |
constructor to use if you have enough memory
- Parameters
-
positivePaths | paths leading to positive examples |
negativePaths | paths leading to negative examples |
toFile | all the relevant information for building the detector |
blackList | what are the examples to eliminate before starting training |
positiveWeight | how much weight to give to positive examples at the beginning |
trainMode | training or validation set |
allInMemory | do everything in memory or on disk |
Definition at line 42 of file TrainExamples.cpp.
TrainExamples::~TrainExamples |
( |
| ) |
|
void TrainExamples::adaboost |
( |
| ) |
|
VectorXi * TrainExamples::calcEmpiricalError |
( |
vector< stumpRule > const * |
cascade, |
|
|
VectorXf & |
tweaks, |
|
|
int |
layerCount, |
|
|
float & |
falsePositive, |
|
|
float & |
detectionRate, |
|
|
bool |
hasReturn |
|
) |
| |
evaluate how the committee fares on a dataset
- Parameters
-
cascade | a given cascade of committees |
tweaks | used for fulfill each layer's training target |
layerCount | how many layers are there in the cascade |
- Returns
- falsePositive
-
detectionRate
- Parameters
-
hasReturn | whether to return a blackList pointing to false negative and true negatives |
Definition at line 524 of file TrainExamples.cpp.
void TrainExamples::decisionStump |
( |
int |
featureIndex, |
|
|
stumpRule & |
best |
|
) |
| |
|
private |
float TrainExamples::getExampleFeature |
( |
int |
featureIndex, |
|
|
int |
iterator |
|
) |
| |
|
inlineprivate |
return for an element pointed by iterator and featureIndex its example value
Definition at line 177 of file TrainExamples.h.
int TrainExamples::getExampleIndex |
( |
int |
featureIndex, |
|
|
int |
iterator |
|
) |
| |
|
inlineprivate |
return for an element pointed by iterator and featureIndex its exampleIndex
Definition at line 167 of file TrainExamples.h.
void TrainExamples::predictLabel |
( |
float |
thresholdTweak, |
|
|
RowVectorXi & |
prediction, |
|
|
bool |
onlyMostRecent |
|
) |
| |
|
private |
given a tweak and a committe, what prediction do you make as to the examples
- Parameters
-
- Returns
- prediction
- Parameters
-
onlyMostRecent | use all the committee or its most recent member (a weak learner) |
Definition at line 265 of file TrainExamples.cpp.
MatrixXf ** TrainExamples::sampleNegatives |
( |
int |
patchSize, |
|
|
vector< stumpRule > * |
cascade, |
|
|
VectorXf & |
tweaks, |
|
|
int |
layerCount, |
|
|
const char * |
negativeExamples, |
|
|
VectorXi * |
blackList |
|
) |
| |
|
private |
vector< pair<float, int> >* TrainExamples::ascendingFeatures |
long double TrainExamples::exponentialRisk |
int TrainExamples::featureCount |
long double TrainExamples::initialPositiveWeight |
bool TrainExamples::inTrain |
VectorXi TrainExamples::labels |
long double TrainExamples::maxWeight |
long double TrainExamples::minWeight |
const char* TrainExamples::negativeImagePaths |
long double TrainExamples::negativeTotalWeight |
int TrainExamples::nNegatives |
int TrainExamples::nPositives |
what's inside
- Parameters
-
nPositives | number of positive examples |
nNegatives | number of negative examples |
sampleCount | nPositives + nNegatives |
inTrain | is this a training set or a validation set |
initialPositiveWeight | how much weight we give to positives at the outset |
exponentialRisk | exponential risk for training set |
positiveTotalWeight | total weight received by positive examples currently |
negativeTotalWeight | total weight received by negative examples currently |
minWeight | minimum weight among all weights currently |
maxWeight | maximum weight among all weights currently |
weights | weight vector for all examples involved |
labels | are they positive or negative examples |
ascendingFeatures | for each feature, we have (float feature value, int exampleIndex) |
featureCount | how many features are there |
committee | what's the learned committee |
Definition at line 75 of file TrainExamples.h.
long double TrainExamples::positiveTotalWeight |
int TrainExamples::sampleCount |
MatrixXf* TrainExamples::validationExamples |
The documentation for this class was generated from the following files: