-
-
Notifications
You must be signed in to change notification settings - Fork 655
Open
Labels
Description
🚀 Feature
Hi @vfdev-5 ,
In the current implementation of MONAI handlers, they are deeply coupled with ignite engine.
Some users that use different workflows can't leverage our handlers, so we are trying to make handlers decouple from ignite.
We discussed the problem and got some basic ideas:
- Add
dict
properties to theengine
, then handlers can treatengine
arg as a regular dict with same structure as ignite Engine object. - Pass the event name when trigger handler, so other workflows also can call this handler with the same event name.
For example:
class TestHandler:
def attach(self):
# ignite specific logic
... ...
def __call__(self, data: Dict, event: str):
# data map to the engine dict of ignite
if event == "ITERATION_COMPLETED":
self._iteration(data)
if event == "EPOCH_COMPLETED":
self._epoch(data)
What do you think?
sdesrozis