Add loss_goal, npoints_goal, and an auto_goal function and use it in the runners#382
Add loss_goal, npoints_goal, and an auto_goal function and use it in the runners#382basnijholt merged 33 commits intomainfrom
Conversation
35d0e5d to
257c469
Compare
akhmerov
left a comment
There was a problem hiding this comment.
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 |
akhmerov
left a comment
There was a problem hiding this comment.
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
jbweston
left a comment
There was a problem hiding this comment.
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 <joseph@weston.cloud>
Co-authored-by: Joseph Weston <joseph@weston.cloud>
akhmerov
left a comment
There was a problem hiding this comment.
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)pytestpassedType of change
Check relevant option(s).