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

C# IMLTrain类代码示例

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

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



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

示例1: Init

 public void Init(IMLTrain train_0)
 {
     this._xd87f6a9c53c2ed9f = train_0;
     this._x6947f9fc231e17e8 = (IMomentum) train_0;
     this._x6c7711ed04d2ac90 = false;
     this._x6947f9fc231e17e8.Momentum = 0.0;
     this._xd02ba004f6c6d639 = 0.0;
 }
开发者ID:neismit,项目名称:emds,代码行数:8,代码来源:SmartMomentum.cs


示例2: Init

 public void Init(IMLTrain train)
 {
     basicTrainSOM = train as BasicTrainSOM;
     if (basicTrainSOM == null)
     {
         throw new ArgumentException(
             String.Format("Argument shoud be of {0} type.", typeof(BasicTrainSOM)), "train");
     }
 }
开发者ID:marcin-mini-pw,项目名称:nnetwork_mini_pw,代码行数:9,代码来源:KohonenTrainStrategy.cs


示例3: Init

 public virtual void Init(IMLTrain train)
 {
     this._xd87f6a9c53c2ed9f = train;
     while (!(train.Method is IMLResettable))
     {
         throw new TrainingError("To use the reset strategy the machine learning method must support MLResettable.");
     }
     this._x1306445c04667cc7 = (IMLResettable) this._xd87f6a9c53c2ed9f.Method;
 }
开发者ID:neismit,项目名称:emds,代码行数:9,代码来源:ResetStrategy.cs


示例4: Init

 /// <summary>
 /// Initialize this strategy.
 /// </summary>
 ///
 /// <param name="train">The training algorithm.</param>
 public void Init(IMLTrain train)
 {
     _train = train;
     _ready = false;
     _setter = (ILearningRate) train;
     _trainingSize = train.Training.Count;
     _currentLearningRate = 1.0d/_trainingSize;
     EncogLogging.Log(EncogLogging.LevelDebug, "Starting learning rate: "
                                                + _currentLearningRate);
     _setter.LearningRate = _currentLearningRate;
 }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:16,代码来源:SmartLearningRate.cs


示例5: HybridStrategy

 public HybridStrategy(IMLTrain altTrain, double minImprovement, int tolerateMinImprovement, int alternateCycles)
 {
     if (((((uint) minImprovement) | 2) != 0) && (0 == 0))
     {
         this._xa45232be281da68a = altTrain;
         this._x6c7711ed04d2ac90 = false;
     }
     this._x123e81b4d1593407 = 0;
     this._x75deb38bfba59a18 = minImprovement;
     this._x671aa26bb37ef7df = tolerateMinImprovement;
     this._x2801df77d59cbd36 = alternateCycles;
 }
开发者ID:neismit,项目名称:emds,代码行数:12,代码来源:HybridStrategy.cs


示例6: CrossValidationKFold

        /// <summary>
        /// Construct a cross validation trainer.
        /// </summary>
        ///
        /// <param name="train">The training</param>
        /// <param name="k">The number of folds.</param>
        public CrossValidationKFold(IMLTrain train, int k) : base(train.Method, (FoldedDataSet) train.Training)
        {
            _train = train;
            Folded.Fold(k);

            _flatNetwork = ((BasicNetwork) train.Method).Structure.Flat;

            _networks = new NetworkFold[k];
            for (int i = 0; i < _networks.Length; i++)
            {
                _networks[i] = new NetworkFold(_flatNetwork);
            }
        }
开发者ID:jongh0,项目名称:MTree,代码行数:19,代码来源:CrossValidationKFold.cs


示例7: TestTraining

        public static void TestTraining(IMLTrain train, double requiredImprove)
        {
            train.Iteration();
            double error1 = train.Error;

            for (int i = 0; i < 10; i++)
                train.Iteration();

            double error2 = train.Error;

            double improve = (error1 - error2) / error1;
            Assert.IsTrue(improve >= requiredImprove,"Improve rate too low for " + train.GetType().Name +
                    ",Improve=" + improve + ",Needed=" + requiredImprove);
        }
开发者ID:Romiko,项目名称:encog-dotnet-core,代码行数:14,代码来源:NetworkUtil.cs


示例8: Init

        /// <summary>
        /// Initialize this strategy.
        /// </summary>
        ///
        /// <param name="train">The training algorithm.</param>
        public virtual void Init(IMLTrain train)
        {
            _train = train;
            _ready = false;

            if (!(train.Method is IMLEncodable))
            {
                throw new TrainingError(
                    "To make use of the Greedy strategy the machine learning method must support MLEncodable.");
            }

            _method = ((IMLEncodable) train.Method);
            _lastNetwork = new double[_method.EncodedArrayLength()];
        }
开发者ID:CreativelyMe,项目名称:encog-dotnet-core,代码行数:19,代码来源:Greedy.cs


示例9: Init

 public virtual void Init(IMLTrain train)
 {
     this._xd87f6a9c53c2ed9f = train;
     this._x6c7711ed04d2ac90 = false;
     while (!(train.Method is IMLEncodable))
     {
         throw new TrainingError("To make use of the Greedy strategy the machine learning method must support MLEncodable.");
     }
     do
     {
         this._x1306445c04667cc7 = (IMLEncodable) train.Method;
     }
     while (2 == 0);
     this._x8ca12f17f1ae2b01 = new double[this._x1306445c04667cc7.EncodedArrayLength()];
 }
开发者ID:neismit,项目名称:emds,代码行数:15,代码来源:Greedy.cs


示例10: Init

 public void Init(IMLTrain train)
 {
     this._xd87f6a9c53c2ed9f = train;
     while (true)
     {
         this._x6c7711ed04d2ac90 = false;
         this._x6947f9fc231e17e8 = (ILearningRate) train;
         this._x985befeef351542c = train.Training.Count;
         this._x6300a707dc67f3a2 = 1.0 / ((double) this._x985befeef351542c);
         EncogLogging.Log(0, "Starting learning rate: " + this._x6300a707dc67f3a2);
         do
         {
             this._x6947f9fc231e17e8.LearningRate = this._x6300a707dc67f3a2;
         }
         while (-2147483648 == 0);
         if (0 == 0)
         {
             return;
         }
     }
 }
开发者ID:neismit,项目名称:emds,代码行数:21,代码来源:SmartLearningRate.cs


示例11: CrossValidationKFold

 public CrossValidationKFold(IMLTrain train, int k)
     : base(train.Method, (FoldedDataSet) train.Training)
 {
     int num;
     if ((((uint) k) | 1) != 0)
     {
         this._xd87f6a9c53c2ed9f = train;
         base.Folded.Fold(k);
         goto Label_0083;
     }
     if (0xff != 0)
     {
         goto Label_0083;
     }
     Label_0039:
     num = 0;
     while (num < this._x5f6ed0047d99f4b6.Length)
     {
         this._x5f6ed0047d99f4b6[num] = new NetworkFold(this._xef94864849922d07);
         if (((uint) k) >= 0)
         {
         }
         num++;
     }
     if (((uint) num) <= uint.MaxValue)
     {
         return;
     }
     Label_0083:
     this._xef94864849922d07 = ((BasicNetwork) train.Method).Structure.Flat;
     this._x5f6ed0047d99f4b6 = new NetworkFold[k];
     if (8 == 0)
     {
         return;
     }
     goto Label_0039;
 }
开发者ID:neismit,项目名称:emds,代码行数:37,代码来源:CrossValidationKFold.cs


示例12: 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


示例13: 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


示例14: ReportTraining

 /// <summary>
 /// 
 /// </summary>
 ///
 public void ReportTraining(IMLTrain train)
 {
     Console.Out.WriteLine("Iteration #"
                           + Format.FormatInteger(train.IterationNumber)
                           + " Error:"
                           + Format.FormatPercent(train.Error)
                           + " elapsed time = "
                           + Format.FormatTimeSpan((int) (_stopwatch.ElapsedMilliseconds/Format.MiliInSec)));
 }
开发者ID:firestrand,项目名称:encog-dotnet-core,代码行数:13,代码来源:ConsoleAnalystListener.cs


示例15: Init

 /// <summary>
 /// Initialize this strategy.
 /// </summary>
 ///
 /// <param name="train_0">The training algorithm.</param>
 public void Init(IMLTrain train_0)
 {
     _train = train_0;
     _setter = (IMomentum) train_0;
     _ready = false;
     _setter.Momentum = 0.0d;
     _currentMomentum = 0;
 }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:13,代码来源:SmartMomentum.cs


示例16: Init

 /// <summary>
 /// 
 /// </summary>
 ///
 public virtual void Init(IMLTrain train)
 {
     _train = train;
     _shouldStop = false;
     _ready = false;
 }
开发者ID:CreativelyMe,项目名称:encog-dotnet-core,代码行数:10,代码来源:StopTrainingStrategy.cs


示例17: Init

 /// <inheritdoc/>
 public virtual void Init(IMLTrain train)
 {
     _started = true;
     _startedTime = DateTime.Now.Ticks;
 }
开发者ID:jongh0,项目名称:MTree,代码行数:6,代码来源:EndMinutesStrategy.cs


示例18: 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


示例19: 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


示例20: TrainDialog

 /// <summary>
 /// Train, using the specified training method, display progress to a dialog
 /// box.
 /// </summary>
 /// <param name="train">The training method to use.</param>
 /// <param name="network">The network to train.</param>
 /// <param name="trainingSet">The training set to use.</param>
 public static void TrainDialog(IMLTrain train,
                                BasicNetwork network, IMLDataSet trainingSet)
 {
     var dialog = new TrainingDialog {Train = train};
     dialog.ShowDialog();
 }
开发者ID:tonyc2a,项目名称:encog-dotnet-core,代码行数:13,代码来源:EncogUtility.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IMVCForumContext类代码示例发布时间:2022-05-24
下一篇:
C# IMLMethod类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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