pytorch / pytorch/ignite

Add `dict` properties to Engine and State

Open
#2,000 13 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

needs-discussion question
Dominant language
Python
Stars
4.8k
Forks
726
Avg merge
5d 21h
Merged PRs (30d)
5

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:

  1. Add dict properties to the engine, then handlers can treat engine arg as a regular dict with same structure as ignite Engine object.
  2. 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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files or tests; start by reviewing the MONAI handlers and the Ignite Engine and State interfaces they currently depend on. Define the required dict-like data and event-passing behavior, then verify that handlers can be called from workflows that do not use Ignite.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.