Action<FastTreeBinaryClassificationTrainer.Arguments> argsFunc = (args) =>
{
args.LearningRates = 0.1;
};
var trainer = mlContext.BinaryClassification.Trainers.FastTree(advancedSettings: argsFunc);
What happened?
trainer.Args.LearningRate = the default learning rate of 0.2
What did you expect?
trainer.Args.LearningRate = 0.1
I think this happens because
if (Args.LearningRates != learningRate)
{
using (var ch = Host.Start($"Setting learning rate to: {learningRate} as supplied in the direct arguments."))
Args.LearningRates = learningRate;
}
in BoostingFastTree.cs
Hi @daholste , thank you for your question! I looked at the code, and it seems that in all the other arguments that can be specified directly (minLeaves, numTrees and minDataPointsInLeaves), the advanced settings Action overwrites the directly specified values. @sfilipi , do you know if this is intentional or not?
@daholste , until this issue is resolved, you can specify the learning rate directly and that should work.
We had the directly specified values override the advanced settings, than decided to swap and to have the advancedSettings override the directly specified values. If this is not happening for this trainer, we should fix it.
Also, for Fast Forest, the trainer constructor takes 'learning rate', but the arguments object does not have a property for learning rate. This differs from Fast Tree, LightGbm, and all other algos that accept learning rate, where learning rate is a field on the arguments object if it's a parameter that can be set. It would be awesome & really useful if learning rate could be added to the Fast Forest arguments object. Thank you!
This issue was resolved with the PR above, so I am closing this issue.
At the same time @daholste mentioned not being able to set the learning rate on the Arguments for Fast Forest but can set the learning rate as part of the constructor. After investigating (thanks @yaeldekel ), there should not be a learningRate argument for FastForest -- this was added by mistake. I created a bug to remove learningRate from the FastForest constructor.
Here is the issue for reference: #2237