pytorch / ignite

High-level library to help with training and evaluating neural networks in PyTorch flexibly and transparently.
https://pytorch-ignite.ai
BSD 3-Clause "New" or "Revised" License
4.55k stars 620 forks source link

More EpochMetric's compute_fn output types #1757

Open vfdev-5 opened 3 years ago

vfdev-5 commented 3 years ago

🚀 Feature

Following https://github.com/pytorch/ignite/pull/1700#issuecomment-787151203 we would like to improve EpochMetric by supporting more output types returned by compute_fn:

A code snippet on possible implementation: https://github.com/pytorch/ignite/pull/1700#issuecomment-790413236 (It is not tested and maybe wrong, just an idea of how to do it).

It would be also helpful to raise a more user friendly error message if output type is not supported.

We need to update the docs as well.

If interested in fixing this issue, please leave a comment to assign the issue to you.

sdesrozis commented 3 years ago

@vfdev-5 I can help on this if needed.

vfdev-5 commented 3 years ago

Thanks @sdesrozis , I mentioned this issue in #1729 and asked @Moh-Yakoub if he'd like to give a try...

vfdev-5 commented 3 years ago

Detectron2 code to inspire from: https://github.com/facebookresearch/detectron2/blob/7f8f29deae278b75625872c8a0b00b74129446ac/detectron2/utils/comm.py#L148