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


C# IMLTrain.FinishTraining方法代码示例

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


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

示例1: TrainConsole

        /// <summary>
        /// Train the network, using the specified training algorithm, and send the
        /// output to the console.
        /// </summary>
        /// <param name="train">The training method to use.</param>
        /// <param name="network">The network to train.</param>
        /// <param name="trainingSet">The training set.</param>
        /// <param name="minutes">The number of minutes to train for.</param>
        public static void TrainConsole(IMLTrain train,
                                        BasicNetwork network, IMLDataSet trainingSet,
                                        int minutes)
        {
            int epoch = 1;
            long remaining;

            Console.WriteLine(@"Beginning training...");
            long start = Environment.TickCount;
            do
            {
                train.Iteration();

                long current = Environment.TickCount;
                long elapsed = (current - start)/1000;
                remaining = minutes - elapsed/60;

                Console.WriteLine(@"Iteration #" + Format.FormatInteger(epoch)
                                  + @" Error:" + Format.FormatPercent(train.Error)
                                  + @" elapsed time = " + Format.FormatTimeSpan((int) elapsed)
                                  + @" time left = "
                                  + Format.FormatTimeSpan((int) remaining*60));
                epoch++;
            } while (remaining > 0 && !train.TrainingDone);
            train.FinishTraining();
        }
开发者ID:tonyc2a,项目名称:encog-dotnet-core,代码行数:34,代码来源:EncogUtility.cs

示例2: TrainToError

        /// <summary>
        /// Train to a specific error, using the specified training method, send the
        /// output to the console.
        /// </summary>
        ///
        /// <param name="train">The training method.</param>
        /// <param name="error">The desired error level.</param>
        public static void TrainToError(IMLTrain train, double error)
        {

            int epoch = 1;

            Console.Out.WriteLine(@"Beginning training...");

            do
            {
                train.Iteration();

                Console.Out.WriteLine(@"Iteration #" + Format.FormatInteger(epoch)
                        + @" Error:" + Format.FormatPercent(train.Error)
                        + @" Target Error: " + Format.FormatPercent(error));
                epoch++;
            } while ((train.Error > error) && !train.TrainingDone);
            train.FinishTraining();
        }
开发者ID:tonyc2a,项目名称:encog-dotnet-core,代码行数:25,代码来源:EncogUtility.cs

示例3: PerformTraining

        /// <summary>
        ///     Perform the training.
        /// </summary>
        /// <param name="train">The training method.</param>
        /// <param name="method">The ML method.</param>
        /// <param name="trainingSet">The training set.</param>
        private void PerformTraining(IMLTrain train, IMLMethod method,
            IMLDataSet trainingSet)
        {
            ValidateNetwork.ValidateMethodToData(method, trainingSet);
            double targetError = Prop.GetPropertyDouble(
                ScriptProperties.MlTrainTargetError);
            Analyst.ReportTrainingBegin();
            int maxIteration = Analyst.MaxIteration;

            if (train.ImplementationType == TrainingImplementationType.OnePass)
            {
                train.Iteration();
                Analyst.ReportTraining(train);
            }
            else
            {
                do
                {
                    train.Iteration();
                    Analyst.ReportTraining(train);
                } while ((train.Error > targetError)
                         && !Analyst.ShouldStopCommand()
                         && !train.TrainingDone
                         && ((maxIteration == -1) || (train.IterationNumber < maxIteration)));
            }
            train.FinishTraining();

            Analyst.ReportTrainingEnd();
        }
开发者ID:kedrzu,项目名称:encog-dotnet-core,代码行数:35,代码来源:CmdTrain.cs

示例4: x0d87de1eb44df41c

 private void x0d87de1eb44df41c(IMLTrain xd87f6a9c53c2ed9f, IMLMethod x1306445c04667cc7, IMLDataSet x1c9e132f434262d8)
 {
     int maxIteration;
     ValidateNetwork.ValidateMethodToData(x1306445c04667cc7, x1c9e132f434262d8);
     double propertyDouble = base.Prop.GetPropertyDouble("ML:TRAIN_targetError");
     base.Analyst.ReportTrainingBegin();
     if ((((uint) maxIteration) & 0) == 0)
     {
         if (2 == 0)
         {
             goto Label_0038;
         }
         maxIteration = base.Analyst.MaxIteration;
         if (0xff != 0)
         {
             goto Label_0038;
         }
     }
     Label_001B:
     if (!xd87f6a9c53c2ed9f.TrainingDone && ((maxIteration == -1) || (xd87f6a9c53c2ed9f.IterationNumber < maxIteration)))
     {
         goto Label_0038;
     }
     Label_0023:
     xd87f6a9c53c2ed9f.FinishTraining();
     base.Analyst.ReportTrainingEnd();
     return;
     Label_0038:
     xd87f6a9c53c2ed9f.Iteration();
     base.Analyst.ReportTraining(xd87f6a9c53c2ed9f);
     if ((xd87f6a9c53c2ed9f.Error <= propertyDouble) || base.Analyst.ShouldStopCommand())
     {
         goto Label_0023;
     }
     goto Label_001B;
 }
开发者ID:neismit,项目名称:emds,代码行数:36,代码来源:CmdTrain.cs

示例5: TrainToError

 public static void TrainToError(IMLTrain train, IMLDataSet trainingSet, double error)
 {
     string[] strArray;
     int i = 1;
     if ((((uint) i) - ((uint) error)) <= uint.MaxValue)
     {
         goto Label_00AF;
     }
     goto Label_0050;
     Label_0037:
     if ((train.Error > error) && !train.TrainingDone)
     {
         goto Label_00B9;
     }
     train.FinishTraining();
     if ((((uint) i) | 3) != 0)
     {
         return;
     }
     goto Label_00AF;
     Label_0050:
     strArray[1] = Format.FormatInteger(i);
     do
     {
         if (0 != 0)
         {
             goto Label_0037;
         }
         strArray[2] = " Error:";
     }
     while ((((uint) error) + ((uint) i)) > uint.MaxValue);
     strArray[3] = Format.FormatPercent(train.Error);
     strArray[4] = " Target Error: ";
     strArray[5] = Format.FormatPercent(error);
     Console.WriteLine(string.Concat(strArray));
     i++;
     goto Label_0037;
     Label_00AF:
     Console.WriteLine("Beginning training...");
     Label_00B9:
     train.Iteration();
     strArray = new string[6];
     strArray[0] = "Iteration #";
     goto Label_0050;
 }
开发者ID:neismit,项目名称:emds,代码行数:45,代码来源:EncogUtility.cs

示例6: TrainConsole

 public static void TrainConsole(IMLTrain train, BasicNetwork network, IMLDataSet trainingSet, int minutes)
 {
     long num2;
     long num4;
     long num5;
     int i = 1;
     Console.WriteLine("Beginning training...");
     long tickCount = Environment.TickCount;
     goto Label_018E;
     Label_0025:
     train.FinishTraining();
     if ((((uint) num5) & 0) != 0)
     {
         goto Label_018E;
     }
     return;
     Label_003A:
     if (((((uint) minutes) - ((uint) tickCount)) >= 0) && (0 == 0))
     {
         goto Label_0025;
     }
     Label_0052:
     if (num2 > 0L)
     {
         if (!train.TrainingDone)
         {
             goto Label_018E;
         }
         goto Label_003A;
     }
     goto Label_0025;
     Label_018E:
     train.Iteration();
     Label_0194:
     num4 = Environment.TickCount;
     num5 = (num4 - tickCount) / 0x3e8L;
     num2 = minutes - (num5 / 60L);
     while (true)
     {
         string[] strArray = new string[8];
         if ((((uint) num5) | 4) == 0)
         {
             goto Label_0194;
         }
         strArray[0] = "Iteration #";
         strArray[1] = Format.FormatInteger(i);
         strArray[2] = " Error:";
         strArray[3] = Format.FormatPercent(train.Error);
         strArray[4] = " elapsed time = ";
         if ((((uint) i) + ((uint) i)) >= 0)
         {
             if ((((uint) num4) & 0) == 0)
             {
                 if ((((uint) minutes) + ((uint) minutes)) > uint.MaxValue)
                 {
                     goto Label_0025;
                 }
                 if (((uint) num5) > uint.MaxValue)
                 {
                     goto Label_003A;
                 }
                 strArray[5] = Format.FormatTimeSpan((int) num5);
                 strArray[6] = " time left = ";
             }
             strArray[7] = Format.FormatTimeSpan(((int) num2) * 60);
             Console.WriteLine(string.Concat(strArray));
             i++;
             goto Label_0052;
         }
     }
 }
开发者ID:neismit,项目名称:emds,代码行数:71,代码来源:EncogUtility.cs


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