Skip to content

Conversation

DrStoop
Copy link

@DrStoop DrStoop commented Oct 22, 2019

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 Metrics will follow up...

Fixes #643

Description:

Check list:

  • pytests were passed with constant number of failed tests, before/after = 14 of 341 / 14 of 341
  • Test backward compatibility on few older examples (I only have 'fresh' code running)
  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

…_()` 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.
Copy link
Collaborator

@vfdev-5 vfdev-5 left a 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

@DrStoop
Copy link
Author

DrStoop commented Oct 22, 2019

Great, I'm happy to see that merged 👍

... by the way despite some subclasses of Metric, I will also provide some more enhancements the next day, so we can check if they are appropriate, too.I'll try to issue them in a easy-to-merge order.

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Oct 22, 2019

@DrStoop sorry, yes, you are right about other classes. Maybe we would need to get them all in this PR.

@DrStoop
Copy link
Author

DrStoop commented Oct 22, 2019

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...

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Jan 21, 2020

@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 reset at the begining and after each compute...

@DrStoop
Copy link
Author

DrStoop commented Jan 22, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ignite.metrics.Metric for all use-cases: Expand Metric's arguments by attachment events

2 participants