本文整理汇总了C++中OutputInfo::headerEndLine方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputInfo::headerEndLine方法的具体用法?C++ OutputInfo::headerEndLine怎么用?C++ OutputInfo::headerEndLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputInfo
的用法示例。
在下文中一共展示了OutputInfo::headerEndLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
void SoftCascadeLearner::run(const nor_utils::Args& args)
{
// load the arguments
this->getArgs(args);
//print cascade properties
if (_verbose > 0) {
cout << "[+] Softcascade parameters :" << endl
<< "\t --> target detection rate = " << _targetDetectionRate << endl
<< "\t --> alpha (exp param) = " << _alphaExponentialParameter << endl
<< "\t --> bootstrap rate = " << _bootstrapRate << endl
<< endl;
}
// get the registered weak learner (type from name)
BaseLearner* pWeakHypothesisSource =
BaseLearner::RegisteredLearners().getLearner(_baseLearnerName);
// initialize learning options; normally it's done in the strong loop
// also, here we do it for Product learners, so input data can be created
pWeakHypothesisSource->initLearningOptions(args);
// get the training input data, and load it
InputData* pTrainingData = pWeakHypothesisSource->createInputData();
pTrainingData->initOptions(args);
pTrainingData->load(_trainFileName, IT_TRAIN, 5);
InputData* pBootstrapData = NULL;
if (!_bootstrapFileName.empty()) {
pBootstrapData = pWeakHypothesisSource->createInputData();
pBootstrapData->initOptions(args);
pBootstrapData->load(_bootstrapFileName, IT_TRAIN, 5);
}
// get the testing input data, and load it
InputData* pTestData = NULL;
if ( !_testFileName.empty() )
{
pTestData = pWeakHypothesisSource->createInputData();
pTestData->initOptions(args);
pTestData->load(_testFileName, IT_TEST, 5);
}
Serialization ss(_shypFileName, false );
ss.writeHeader(_baseLearnerName);
// outputHeader();
// The output information object
OutputInfo* pOutInfo = NULL;
if ( !_outputInfoFile.empty() )
{
pOutInfo = new OutputInfo(args, true);
pOutInfo->setOutputList("sca", &args);
pOutInfo->initialize(pTrainingData);
if (pTestData)
pOutInfo->initialize(pTestData);
pOutInfo->outputHeader(pTrainingData->getClassMap(), true, true, false);
pOutInfo->outputUserHeader("thresh");
pOutInfo->headerEndLine();
}
// ofstream trainPosteriorsFile;
// ofstream testPosteriorsFile;
const NameMap& namemap = pTrainingData->getClassMap();
_positiveLabelIndex = namemap.getIdxFromName(_positiveLabelName);
// FIXME: output posteriors
// OutputInfo* pTrainPosteriorsOut = NULL;
// OutputInfo* pTestPosteriorsOut = NULL;
// if (! _trainPosteriorsFileName.empty()) {
// pTrainPosteriorsOut = new OutputInfo(_trainPosteriorsFileName, "pos", true);
// pTrainPosteriorsOut->initialize(pTrainingData);
// dynamic_cast<PosteriorsOutput*>( pTrainPosteriorsOut->getOutputInfoObject("pos") )->addClassIndex(_positiveLabelIndex );
// }
// if (! _testPosteriorsFileName.empty() && !_testFileName.empty() ) {
// pTestPosteriorsOut = new OutputInfo(_testPosteriorsFileName, "pos", true);
// pTestPosteriorsOut->initialize(pTestData);
// dynamic_cast<PosteriorsOutput*>( pTestPosteriorsOut->getOutputInfoObject("pos") )->addClassIndex(_positiveLabelIndex );
// }
const int numExamples = pTrainingData->getNumExamples();
vector<BaseLearner*> inWeakHypotheses;
if (_fullRun) {
// TODO : the full training is implementet, testing is needed
AdaBoostMHLearner* sHypothesis = new AdaBoostMHLearner();
sHypothesis->run(args, pTrainingData, _baseLearnerName, _numIterations, inWeakHypotheses );
delete sHypothesis;
//.........这里部分代码省略.........