-
Notifications
You must be signed in to change notification settings - Fork 58
Add loss_goal, npoints_goal, and an auto_goal function and use it in the runners #382
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
35d0e5d
to
257c469
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.
I like the idea of simplifying common use cases, and therefore I find the MR promising, however I think that the logic for interpreting the input is too obscure and would hurt readability. Instead we could introduce alternative arguments to the runner, e.g. Runner(..., time=...)
etc.
Codecov Report
@@ Coverage Diff @@
## main #382 +/- ##
==========================================
+ Coverage 77.73% 77.92% +0.18%
==========================================
Files 37 37
Lines 5422 5508 +86
Branches 981 989 +8
==========================================
+ Hits 4215 4292 +77
- Misses 1061 1065 +4
- Partials 146 151 +5
📣 We’re building smart automated test selection to slash your CI/CD build times. 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 thought about it more, and I'm pretty sure that bundling all options into goal makes the code less readable and more error-prone. I think adding to the runner a handful of arguments that specify different termination conditions is the way to go.
There are examples where input interpretation depends on its shape, in particular a bunch of numpy API, but I don't know where as much of interpretation would depend on input types.
c619895
to
1c90e51
Compare
1c90e51
to
05be948
Compare
d1635c6
to
2a77ca2
Compare
Thanks! A naming question: do we want to keep |
6f11ad6
to
761afa8
Compare
I,
I think having the |
0920725
to
84bd796
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.
Nice feature!
There are a few minor fixups that could be applied, but other thatn that this is good to merge.
Co-authored-by: Joseph Weston <[email protected]>
Co-authored-by: Joseph Weston <[email protected]>
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.
All looks good, thanks. I still think that _goal
is superfluous in some of the new arguments like duration
or end_time
, but I leave this for you to decide.
Like I mentioned in #382 (comment) I think keeping the
And it will be clear that they have a different meaning from the other parameters of e.g., the
|
I see, thanks for the explanation. I agree with the reasoning. |
Description
Add more loss options to Runners to easily set common loss conditions.
For example:
Still one is also able to use
auto_goal
:Checklist
pre-commit run --all
(first install usingpip install pre-commit
)pytest
passedType of change
Check relevant option(s).