简体   繁体   English

指定 ML.NET 模型的训练持续时间

[英]Specifying a training duration for a ML.NET model

This might be an obvious question, but I can't seem to find anything on it in the ML.NET Microsoft Documentation.这可能是一个显而易见的问题,但我似乎在 ML.NET Microsoft 文档中找不到任何关于它的内容。

I've been trying to get into the ML.NET framework for a bit now, and the documentation always follows the same basic procedure, namely creating an estimator chain and fitting the chain to the data, essentially training the model.我一直在尝试进入 ML.NET 框架一段时间,并且文档始终遵循相同的基本过程,即创建估计器链并将该链拟合到数据,本质上是训练模型。

The documentation also specifies that you should experiment with different training durations, which is where my question comes in: How do you specify a training duration?该文档还指定您应该尝试不同的培训持续时间,这就是我的问题所在:您如何指定培训持续时间? Every time I spot a "training" method in the docs, it's always just每次我在文档中发现“训练”方法时,总是

ITransformer model = pipeline.Fit(data);

without any possibility to specify a training duration.没有任何可能指定培训持续时间。 Am I missing the obvious here?我在这里错过了明显的东西吗? Do you specify the duration in the estimator chain?您是否在估算器链中指定持续时间? Any help on this is greatly appreciated.非常感谢您对此的任何帮助。

Machine learning algorithms have different behaviors, some models provide settings such as steps to be trained as input, or duration, or epoch, or error rate etc... and the result is different from one run to another.机器学习算法有不同的行为,一些模型提供设置,例如要训练的步骤作为输入,或持续时间,或时期,或错误率等......结果从一次运行到另一次运行是不同的。 But some others, have a fixed algorithm and always have the same out put and no matter how many times you run trainer, the result is the same.但是其他一些,有一个固定的算法并且总是有相同的输出,无论你运行多少次训练器,结果都是一样的。 I think your model is the latter case.我认为你的模型是后一种情况。

Note that changing the input parameters of the model change the training duration, In the machine learning context "different training durations" means changing the model's parameter to find the optimum values.请注意,更改模型的输入参数会更改训练持续时间,在机器学习上下文中,“不同的训练持续时间”意味着更改模型的参数以找到最佳值。

In your case, changing the following settings may change your training duration:在您的情况下,更改以下设置可能会更改您的训练时长:

// Define trainer options.
var options = new LbfgsMaximumEntropyMulticlassTrainer.Options
{
    HistorySize = 50,
    L1Regularization = 0.1f,
    NumberOfThreads = 1
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM