-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Polish early stop rules in fast tree #2851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f2da1e7
to
5a6c9c6
Compare
@@ -6622,7 +6622,7 @@ | |||
"Default": "GradientDescent" | |||
}, | |||
{ | |||
"Name": "EarlyStoppingRule", | |||
"Name": "EarlyStoppingRuleFactory", | |||
"Type": { | |||
"Kind": "Component", | |||
"ComponentKind": "EarlyStoppingCriterion" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"ComponentKind": "EarlyStoppingCriterion" [](start = 12, length = 41)
Manifest is broken. Here is a reference to ComponenKInd "EarlyStoppingCriterion" but the Components for this component kind is removed from manifest. This would cause Entrypoint Compiler to fail to figure out fitting components during entrypoint graph parse #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No (at least at iteration 3), those definitions of EarlyStoppingCriterion are still there. Please try searching for "EarlyStoppingCriterion".
In reply to: 262645293 [](ancestors = 262645293)
@@ -482,9 +482,12 @@ public enum OptimizationAlgorithmType { GradientDescent, AcceleratedGradientDesc | |||
/// <summary> | |||
/// Early stopping rule. (Validation set (/valid) is required). | |||
/// </summary> | |||
[BestFriend] | |||
[Argument(ArgumentType.Multiple, HelpText = "Early stopping rule. (Validation set (/valid) is required.)", ShortName = "esr", NullName = "<Disable>")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add attribute Name = "EarlyStoppingRule" this would keep core_manifest.json same and will avoid big changes in NimbusML #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed but I'd expect tons of breaking changes to entry-point had happened somewhere.
In reply to: 262650819 [](ancestors = 262650819)
Codecov Report
@@ Coverage Diff @@
## master #2851 +/- ##
==========================================
+ Coverage 71.7% 71.7% +<.01%
==========================================
Files 810 810
Lines 142473 142542 +69
Branches 16111 16121 +10
==========================================
+ Hits 102159 102210 +51
- Misses 35889 35900 +11
- Partials 4425 4432 +7
|
/// <summary> | ||
/// Create <see cref="IEarlyStoppingCriterionFactory"/> for supporting legacy infra built upon <see cref="IComponentFactory"/>. | ||
/// </summary> | ||
internal abstract IEarlyStoppingCriterionFactory BuildFactory(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internal abstract IEarlyStoppingCriterionFactory BuildFactory(); [](start = 8, length = 64)
How would 3rd party devs create their own EarlyStoppingRuleBase implementations to supply into FastTree algos? This abstract internal method will prevent that #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Component authorship is not a goal for v1, even at the level of people being able to create their own ITransformer
implementations. This is fine. Inf act I would go even further by making this thing have a private protected
constructor.
In reply to: 262757300 [](ancestors = 262757300)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good Tom. I also think creating a proper stopping rule is a challenge to many C# developers.
In reply to: 263023672 [](ancestors = 263023672,262757300)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case if you have only restricted set of EarlyStoppingRule - why dont you go with enum? I dont understand creating such a complicated code where enum will suffice
In reply to: 263048215 [](ancestors = 263048215,263023672,262757300)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to discuss this further. You are exposing EarlyStoppingRule and dont allow devs to use it. If you would decouple Factory from Class/Interface you would get a smaller code change and will allow 3rd party devs create their own stopping rule - same as I did for LossFunction
In reply to: 263057699 [](ancestors = 263057699,263048215,263023672,262757300)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just make a note for our internal discussion --- public area should be as small as possible while all vital functions are still maintained. Thus, we don't allow the implementation of this base class.
In reply to: 263063854 [](ancestors = 263063854,263057699,263048215,263023672,262757300)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ok as far as this pattern is an exception and doesnt propagate to things like LossFunction
In reply to: 263067053 [](ancestors = 263067053,263063854,263057699,263048215,263023672,262757300)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may not affect LossFunction because it's an interface. If LossFunction is a class, the same pattern may apply. As Tom and Ivan have mentioned somewhere, public area should be as small as possible. On the other hand, another pattern here may affect LossFunction where we have a property to hide a field.
In reply to: 263068114 [](ancestors = 263068114,263067053,263063854,263057699,263048215,263023672,262757300)
7470bb7
to
5b071bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @wschin !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix #2520. The pattern implemented in this PR is
You can see that
EarlyStoppingRuleFactory
(used in old infra) is exposed to users by addingEarlyStoppingRule
.