当前位置: 首页>>代码示例>>C#>>正文


C# IExampleInterface.Exit方法代码示例

本文整理汇总了C#中IExampleInterface.Exit方法的典型用法代码示例。如果您正苦于以下问题:C# IExampleInterface.Exit方法的具体用法?C# IExampleInterface.Exit怎么用?C# IExampleInterface.Exit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IExampleInterface的用法示例。


在下文中一共展示了IExampleInterface.Exit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public void Execute(IExampleInterface app)
        {
            this.app = app;
            FileInfo dataDir = new FileInfo(Environment.CurrentDirectory);
            if (String.Compare(app.Args[0], "sun", true) == 0)
            {

                SVMPredictSunSpots.PredictSunspotSVM.run();
                MakeAPause();
                app.Exit();
            }
            if (String.Compare(app.Args[0], "svm", true) == 0)
            {
                
               CreateSVMNetWork.Process(
               MLMethodFactory.TypeSVM,
               METHOD_SVMR_A,
               MLTrainFactory.TypeSVM,
               "", 1);
            }
            if (String.Compare(app.Args[0], "random", true) == 0)
            {
                if (app.Args.Length > 1)
                {
                    SVM_Predict.CreateSVMNetWork.RandomTrainerMethod(Convert.ToInt16(app.Args[1]), Convert.ToInt16(app.Args[2]));
                    MakeAPause();
                    app.Exit();
                }
                else
                {
                    Console.WriteLine(@"You didn't input enough args in your request, will default to 3000 inputs , and 50 prediction size");
                    SVM_Predict.CreateSVMNetWork.RandomTrainerMethod(3000, 1);
                    MakeAPause();
                    app.Exit();
                }

            }
        }
开发者ID:JDFagan,项目名称:encog-dotnet-core,代码行数:38,代码来源:SVMExample.cs

示例2: Execute

        public void Execute(IExampleInterface app)
        {
            this.app = app;
            FileInfo dataDir = new FileInfo(Environment.CurrentDirectory);

            if (String.Compare(app.Args[0], "randomtrainer", true) == 0)
            {
                if (app.Args.Length > 1)
                {
                    Encog.Examples.RangeandMarket.RandomTrainer.RandomTrainerMethod(Convert.ToInt16(app.Args[1]), Convert.ToInt16(app.Args[2]));
                   
                }
                else
                {
                    Console.WriteLine(@"You didn't input enough args in your request, will default to 3000 inputs , and 50 prediction size");
                    Encog.Examples.RangeandMarket.RandomTrainer.RandomTrainerMethod(3000, 50);
                    MakeAPause();
                }

            }


            if (String.Compare(app.Args[0], "eval", true) == 0)
            {
                if (app.Args.Length > 0)
                {
                    //We have enough arguments, lets test them.
                    if (File.Exists(app.Args[1]))
                    {

                        BasicMLDataSet set = CreateEval.CreateEvaluationSetAndLoad(app.Args[1], CONFIG.EvalHowMany, CONFIG.EvalStartFrom, CONFIG.Inputs,
                                                  CONFIG.Outputs);

                         //create our network.
                        BasicNetwork network =
                            (BasicNetwork) SuperUtils.LoadNetwork(CONFIG.DIRECTORY, CONFIG.NetWorkFile);
                        CreateEval.EvaluateNetworks(network, set);
                        MakeAPause();
                        app.Exit();
                    }


                }
            }



            if (String.Compare(app.Args[0], "prune", true) == 0)
            {

                //Start pruning.
                Console.WriteLine("Starting the pruning process....");

                Prunes.Incremental(new FileInfo(CONFIG.DIRECTORY), CONFIG.NetWorkFile,
                            CONFIG.TrainingFile);

                MakeAPause();
                app.Exit();


            }
            if (String.Compare(app.Args[0], "train", true) == 0)
            {
                if (app.Args.Length> 0)
                {
                    //We have enough arguments, lets test them.
                    if (File.Exists(app.Args[1]))
                    {
                        //the file exits lets build the training.

                        //create our basic ml dataset.
                       BasicMLDataSet set = CreateEval.CreateEvaluationSetAndLoad(app.Args[1], CONFIG.HowMany, CONFIG.StartFrom, CONFIG.Inputs,
                                                   CONFIG.Outputs);

                        //create our network.
                        BasicNetwork network = (BasicNetwork) CreateEval.CreateElmanNetwork(CONFIG.Inputs, CONFIG.Outputs);

                        //Train it..

                        double LastError = CreateEval.TrainNetworks(network, set);

                        Console.WriteLine("NetWork Trained to :" + LastError);
                        SuperUtils.SaveTraining(CONFIG.DIRECTORY, CONFIG.TrainingFile, set);
                        SuperUtils.SaveNetwork(CONFIG.DIRECTORY, CONFIG.NetWorkFile, network);
                        Console.WriteLine("Network Saved to :" + CONFIG.DIRECTORY + " File Named :" +
                                          CONFIG.NetWorkFile);

                        Console.WriteLine("Training Saved to :" + CONFIG.DIRECTORY + " File Named :" +
                                         CONFIG.TrainingFile);
                        MakeAPause();


                    }
                    else
                    {
                        Console.WriteLine("Couldnt find the file :" + app.Args[2].ToString());
                        Console.WriteLine("Exiting");
                        MakeAPause();
                        app.Exit();
                    }
//.........这里部分代码省略.........
开发者ID:jongh0,项目名称:MTree,代码行数:101,代码来源:MarketAnalyzer.cs


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