-
-
Notifications
You must be signed in to change notification settings - Fork 657
Enhancement of class Metric
by adding attachment events to __init__()
arguments
#644
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
base: master
Are you sure you want to change the base?
Conversation
…_()` arguments: The original `Metric.__init__(self, output_transform=lambda x: x)` is enhanced to `Metric.__init__(output_transform=lambda x: x, started_event=Events.EPOCH_STARTED, iteration_completed_event=Events.ITERATION_COMPLETED, completed_event=Events.EPOCH_COMPLETED) to provide metric updating and computing at any individual event. The default values guarantee backward compatability.
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.
Looks good ! Thanks @DrStoop
Let me fix CI and I'll play a bit with new interface and if OK I'll merge it
Great, I'm happy to see that merged 👍 ... by the way despite some subclasses of |
@DrStoop sorry, yes, you are right about other classes. Maybe we would need to get them all in this PR. |
no problem, wait with the merge. I will open separate issues for each topic I was working on. After deciding on the features to integrate, I'll tie the winners up and pull-request them at once... |
@DrStoop I started to write some tests for this new feature and seems like with current events system it is rather difficult to setup something useful, e.g. # Would like to compute accuracy on the half of the loader
# the following should compute only on the first half
e1 = Events.ITERATION_STARTED(once=1),
e2 = Events.ITERATION_COMPLETED,
e3 = Events.ITERATION_COMPLETED(once=50)
m = Accuracy(..., started_event=e1, iteration_completed_event=e2, completed_event=e3) The problem is with reset event. I added another issue #710 such that if we could pass a composite event we could |
Hi @vfdev-5, yeah that's maybe because it was implemented before the event filter... but i'll come up with something possibly in a week or two... unfortunately won't make it earlier |
The original
Metric.__init__(self, output_transform=lambda x: x)
is enhanced to`Metric.init(output_transform=lambda x: x, started_event=Events.EPOCH_STARTED,
iteration_completed_event=Events.ITERATION_COMPLETED, completed_event=Events.EPOCH_COMPLETED)
to provide metric updating and computing at any individual event. The default values
guarantee backward compatibility.
Modified metrics inheriting from
Metric
s will follow up...Fixes #643
Description:
Check list:
pytest
s were passed with constant number of failed tests, before/after = 14 of 341 / 14 of 341