Optional Metrics #2339
EricZimmermann
started this conversation in
General
Replies: 1 comment 3 replies
-
@EricZimmermann I think we have already though about skipping metric's update if None is passed however there was a blocker from the implementation of I'll provide a prototype example for your use-case here a bit later. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
As mentioned in MONAI discussion here: Project-MONAI/MONAI#3392
Ignite metrics call .update on iteration completed event. In the case where you have a metric that has a NoneType value, is there a recommended way of processing things?
Example:
Given data coming from N sources, I would like to compute per source metrics. For each iteration, I sample M independent items where M < N. This means that M metrics will have a value, and (N-M) will be empty (or NoneType) because no sample to access via output transform for that metric. For the empty values, the engine still calls metric.update but has nothing to access. In the case where it is filled with zeros to try and mitigate this issue, any accumulated metric would also increment leading to invalid summary stats.
Solution:
Wrap metrics to handle NoneTypes (see code snippet below)
I also have a class to format things but did not include it. As mentioned, is there a better or more efficient way to do this currently?
Best,
Eric, @JustinSzeto, @kirillv-cim
Beta Was this translation helpful? Give feedback.
All reactions