本文整理汇总了C++中nor_utils::Args类的典型用法代码示例。如果您正苦于以下问题:C++ Args类的具体用法?C++ Args怎么用?C++ Args使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Args类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: declareArguments
void BanditSingleStumpLearner::declareArguments(nor_utils::Args& args)
{
FeaturewiseLearner::declareArguments(args);
args.declareArgument("updaterule",
"The update weights in the UCT can be the 1-sqrt( 1- edge^2 ) [edge]\n"
" or the alpha [alphas]\n"
" Default is the first one\n",
1, "<type>");
args.declareArgument("rsample",
"Number of features to be considered\n"
" Default is one\n",
1, "<K>");
args.declareArgument("banditalgo",
"The bandit algorithm (UCBK, UCBKRandomized, EXP3 )\n"
"Default is UCBK\n",
1, "<algoname>");
args.declareArgument("percent",
"The percent of database will be used for estimating the payoffs(EXP3G)\n"
" Default is 10%\n",
1, "<p>");
}
示例2: declareArguments
void StochasticLearner::declareArguments(nor_utils::Args& args)
{
BaseLearner::declareArguments(args);
args.declareArgument("graditer",
"Declares the number of randomly drawn training size for SGD"
"whereas it declares the number of iteration for the Batch Gradiend Descend"
" size <num> of training set. "
"Example: --graditer 50 -> Uses only 50 randomly chosen training instance",
1, "<num>");
args.declareArgument("gradmethod",
"Declares the gradient method: "
" (sgd) Stochastic Gradient Descent, (bgd) Batch Gradient Descent"
"Example: --gradmethod sgd -> Uses stochastic gradient method",
1, "<method>");
args.declareArgument("tfunc",
"Target function: "
"exploss: Exponential Loss, edge: max. edge"
"Example: --tfunc exploss -> Uses exponantial loss for minimizing",
1, "<function>");
args.declareArgument("initgamma",
"The initial learning rate in gradient descent"
"Default values is 10.0",
1, "<gamma>");
args.declareArgument("gammdivperiod",
"The periodicity of decreasing the learning rate \\gamma"
"Default values is 1",
1, "<period>");
}
示例3:
MDDAGClassifier::MDDAGClassifier(const nor_utils::Args &args, int verbose)
: _verbose(verbose), _args(args)
{
// The file with the step-by-step information
if ( args.hasArgument("outputinfo") )
args.getValue("outputinfo", 0, _outputInfoFile);
}
示例4: initLearningOptions
void TreeLearner::initLearningOptions(const nor_utils::Args& args)
{
BaseLearner::initLearningOptions(args);
string baseLearnerName;
args.getValue("baselearnertype", 0, baseLearnerName);
args.getValue("baselearnertype", 1, _numBaseLearners);
// get the registered weak learner (type from name)
BaseLearner* pWeakHypothesisSource = BaseLearner::RegisteredLearners().getLearner(baseLearnerName);
//check whether the weak learner is a ScalarLeaerner
try {
_pScalaWeakHypothesisSource = dynamic_cast<ScalarLearner*>(pWeakHypothesisSource);
}
catch (bad_cast& e) {
cerr << "The weak hypothesis must be a ScalarLearner!!!" << endl;
exit(-1);
}
_pScalaWeakHypothesisSource->initLearningOptions(args);
/*
for( int ib = 0; ib < _numBaseLearners; ++ib ) {
vector< int > tmpVector( 2, -1 );
_idxPairs.push_back( tmpVector );
}
*/
}
示例5: initLearningOptions
void EnumLearnerSA::initLearningOptions(const nor_utils::Args& args)
{
BaseLearner::initLearningOptions(args);
if ( args.hasArgument( "uoffset" ) )
args.getValue("uoffset", 0, _uOffset);
}
示例6: getArgs
void MultiMDDAGLearner::getArgs(const nor_utils::Args& args)
{
MDDAGLearner::getArgs(args);
// Set the value of theta
if ( args.hasArgument("updateperc") )
args.getValue("updateperc", 0, _randomNPercent);
}
示例7: initLearningOptions
void BaseLearner::initLearningOptions(const nor_utils::Args& args)
{
if ( args.hasArgument("verbose") )
args.getValue("verbose", 0, _verbose);
// Set the value of theta
if ( args.hasArgument("edgeoffset") )
args.getValue("edgeoffset", 0, _theta);
}
示例8: initLearningOptions
void ParasiteLearner::initLearningOptions(const nor_utils::Args& args)
{
BaseLearner::initLearningOptions(args);
args.getValue("pool", 0, _nameBaseLearnerFile);
args.getValue("pool", 1, _numBaseLearners);
if ( args.hasArgument("closed") )
_closed = 1;
}
示例9: getArgs
void FilterBoostLearner::getArgs(const nor_utils::Args& args)
{
AdaBoostMHLearner::getArgs( args );
// Set the value of the sample size
if ( args.hasArgument("Cn") )
{
args.getValue("C", 0, _Cn);
if (_verbose > 1)
cout << "--> Resampling size: " << _Cn << endl;
}
}
示例10: resumeProcess
int MultiMDDAGLearner::resumeProcess(const nor_utils::Args& args, InputData* pTestData)
{
int numPolicies = 0;
AlphaReal policyAlpha = 0.0;
if ( args.hasArgument("policyalpha") )
args.getValue("policyalpha", 0, policyAlpha);
_policy = new AdaBoostArrayOfPolicyArray(args, _actionNumber);
return numPolicies;
}
示例11: classify
void SoftCascadeLearner::classify(const nor_utils::Args& args)
{
SoftCascadeClassifier classifier(args, _verbose);
string testFileName = args.getValue<string>("test", 0);
string shypFileName = args.getValue<string>("test", 1);
int numIterations = args.getValue<int>("test", 2);
string outResFileName = "";
if ( args.getNumValues("test") > 3 )
args.getValue("test", 3, outResFileName);
classifier.run(testFileName, shypFileName, numIterations, outResFileName);
}
示例12: declareArguments
void ParasiteLearner::declareArguments(nor_utils::Args& args)
{
BaseLearner::declareArguments(args);
args.declareArgument("pool",
"The name of the shyp file containing the pool of\n"
" weak learners, followed by the number of desired\n"
" weak learners. If -1 or more than the number of \n"
" weak learners, we use all of them",
2, "<fileName> <nBaseLearners>");
args.declareArgument("closed", "Include negatives of weak learners (default = false).");
}
示例13: classify
void FilterBoostLearner::classify(const nor_utils::Args& args)
{
FilterBoostClassifier classifier(args, _verbose);
// -test <dataFile> <shypFile>
string testFileName = args.getValue<string>("test", 0);
string shypFileName = args.getValue<string>("test", 1);
int numIterations = args.getValue<int>("test", 2);
string outResFileName;
if ( args.getNumValues("test") > 3 )
args.getValue("test", 3, outResFileName);
classifier.run(testFileName, shypFileName, numIterations, outResFileName);
}
示例14:
VJCascadeClassifier::VJCascadeClassifier(const nor_utils::Args &args, int verbose)
: _verbose(verbose), _args(args), _positiveLabelIndex(-1)
{
// The file with the step-by-step information
if ( args.hasArgument("outputinfo") )
args.getValue("outputinfo", 0, _outputInfoFile);
if ( args.hasArgument("positivelabel") )
{
args.getValue("positivelabel", 0, _positiveLabelName);
} else {
cout << "The name of positive label has to be given!!!" << endl;
exit(-1);
}
}
示例15:
//----------------------------------------------------------------
//----------------------------------------------------------------
void Exp3::initLearningOptions(const nor_utils::Args& args)
{
if ( args.hasArgument( "gamma" ) ){
_gamma = args.getValue<double>("gamma", 0 );
}
}