• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ nor_utils::Args类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中nor_utils::Args的典型用法代码示例。如果您正苦于以下问题:C++ Args类的具体用法?C++ Args怎么用?C++ Args使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Args类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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>");

	}
开发者ID:busarobi,项目名称:MDDAG,代码行数:26,代码来源:BanditSingleStumpLearner.cpp


示例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>");
		
				
	}
开发者ID:busarobi,项目名称:MDDAG2,代码行数:34,代码来源:StochasticLearner.cpp


示例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);
}
开发者ID:busarobi,项目名称:MDDAG2,代码行数:7,代码来源:MDDAGClassifier.cpp


示例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 );
		 }
		 */
	}
开发者ID:busarobi,项目名称:MDDAG2,代码行数:29,代码来源:TreeLearner.cpp


示例5: initLearningOptions

	void EnumLearnerSA::initLearningOptions(const nor_utils::Args& args)
	{
		BaseLearner::initLearningOptions(args);

		if ( args.hasArgument( "uoffset" ) )  
			args.getValue("uoffset", 0, _uOffset);   

	}
开发者ID:ShenWei,项目名称:src,代码行数:8,代码来源:EnumLearnerSA.cpp


示例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);

}
开发者ID:busarobi,项目名称:MDDAG2,代码行数:9,代码来源:MultiMDDAGLearner.cpp


示例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);   
	}
开发者ID:busarobi,项目名称:MDDAG,代码行数:9,代码来源:BaseLearner.cpp


示例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;
}
开发者ID:ShenWei,项目名称:src,代码行数:10,代码来源:ParasiteLearner.cpp


示例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;
		}

	}
开发者ID:busarobi,项目名称:MDDAG,代码行数:12,代码来源:FilterBoostLearner.cpp


示例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;
}
开发者ID:busarobi,项目名称:MDDAG2,代码行数:13,代码来源:MultiMDDAGLearner.cpp


示例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);
 }
开发者ID:junjiek,项目名称:cmu-exp,代码行数:14,代码来源:SoftCascadeLearner.cpp


示例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).");

}
开发者ID:ShenWei,项目名称:src,代码行数:14,代码来源:ParasiteLearner.cpp


示例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);
	}
开发者ID:ShenWei,项目名称:src,代码行数:15,代码来源:FilterBoostLearner.cpp


示例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);
		}				
	}
开发者ID:busarobi,项目名称:MDDAG2,代码行数:15,代码来源:VJCascadeClassifier.cpp


示例15:

//----------------------------------------------------------------
//----------------------------------------------------------------
    void Exp3::initLearningOptions(const nor_utils::Args& args) 
    {
        if ( args.hasArgument( "gamma" ) ){
            _gamma = args.getValue<double>("gamma", 0 );
        } 

    }
开发者ID:junjiek,项目名称:cmu-exp,代码行数:9,代码来源:Exp3.cpp


示例16: showHelp

/**
 * Show the help. Called when -h argument is provided.
 * \date 11/11/2005
 */
void showHelp(nor_utils::Args& args, const vector<string>& learnersList)
{
	cout << "MultiBoost (v" << CURRENT_VERSION << "). An obvious name for a multi-class AdaBoost learner." << endl;
	cout << "------------------------ HELP SECTION --------------------------" << endl;
	
	args.printGroup("Parameters");
	
	cout << endl;
	cout << "For specific help options type:" << endl;
	cout << "   --h general: General options" << endl;
	cout << "   --h io: I/O options" << endl;
	cout << "   --h algo: Basic algorithm options" << endl;
	cout << "   --h bandits: Bandit algorithm options" << endl;
	cout << "   --h vjcascade: Viola-Jones Cascade options" << endl;
	cout << "   --h softcascade: Soft Cascade options" << endl;

	cout << endl;
	cout << "For weak learners specific options type:" << endl;
	
	vector<string>::const_iterator it;
	for (it = learnersList.begin(); it != learnersList.end(); ++it)
		cout << "   --h " << *it << endl;
	
	exit(0);
}
开发者ID:busarobi,项目名称:MDDAG2,代码行数:29,代码来源:main.cpp


示例17: initLearningOptions

	void StochasticLearner::initLearningOptions(const nor_utils::Args& args)
	{
		BaseLearner::initLearningOptions(args);
		
		if (args.hasArgument("initgamma"))
			args.getValue("initgamma", 0, _initialGammat);   		
		
		if (args.hasArgument("gammdivperiod"))
			args.getValue("gammdivperiod", 0, _gammdivperiod);   		
		
		
		if (args.hasArgument("graditer"))
			args.getValue("graditer", 0, _maxIter);   		
		
		if (args.hasArgument("gradmethod"))
		{
			string gradMethod;
			args.getValue("gradmethod", 0, gradMethod);   		
			
			if ( gradMethod.compare( "sgd" ) == 0 )
				_gMethod = OPT_SGD;
			else if ( gradMethod.compare( "bgd" ) == 0 )
				_gMethod = OPT_BGD;
			else {
				cerr << "SigmoidSingleStumpLearner::Unknown update gradient method" << endl;
				exit( -1 );
			}					
		}		
		
		if (args.hasArgument("tfunc"))
		{
			string targetFunction;
			args.getValue("tfunc", 0, targetFunction);
			
			if ( targetFunction.compare( "exploss" ) == 0 )
				_tFunction = TF_EXPLOSS;
			else if ( targetFunction.compare( "edge" ) == 0 )
				_tFunction = TF_EDGE;
			else {
				cerr << "SigmoidSingleStumpLearner::Unknown target function" << endl;
				exit( -1 );				
			}					
			
		}
		
	}
开发者ID:busarobi,项目名称:MDDAG2,代码行数:46,代码来源:StochasticLearner.cpp


示例18: declareArguments

		void EnumLearnerSA::declareArguments(nor_utils::Args& args)
	{
		BaseLearner::declareArguments(args);

		args.declareArgument("uoffset", 
			"The offset of u\n",
			1, "<offset>");

	}
开发者ID:ShenWei,项目名称:src,代码行数:9,代码来源:EnumLearnerSA.cpp


示例19: initLearningOptions

	void FeaturewiseLearner::initLearningOptions(const nor_utils::Args& args)
	{
		AbstainableLearner::initLearningOptions(args);
		_maxNumOfDimensions = numeric_limits<int>::max();
		
		// If the sampling is required
		if ( args.hasArgument("rsample") )
			_maxNumOfDimensions = args.getValue<int>("rsample", 0);
	}
开发者ID:busarobi,项目名称:MDDAG2,代码行数:9,代码来源:FeaturewiseLearner.cpp


示例20: declareArguments

void TreeLearnerUCT::declareArguments(nor_utils::Args& args)
{
    BaseLearner::declareArguments(args);

    args.declareArgument("baselearnertype",
                         "The name of the learner that serves as a basis for the product\n"
                         "  and the number of base learners to be multiplied\n"
                         "  Don't forget to add its parameters\n",
                         2, "<baseLearnerType> <numBaseLearners>");

    args.declareArgument("updaterule",
                         "The update weights in the UCT can be the 1-sqrt( 1- edge^2 ) [edge]\n"
                         "  or the alpha [alphas]\n"
                         "  or edgesquare [edgesquare]\n"
                         "  Default is the first one\n",
                         1, "<type>");

}
开发者ID:junjiek,项目名称:cmu-exp,代码行数:18,代码来源:TreeLearnerUCT.cpp



注:本文中的nor_utils::Args类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ note::Ptr类代码示例发布时间:2022-05-31
下一篇:
C++ nomad::Eval_Point类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap