Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metric can accept a dictionary #689

Closed
vfdev-5 opened this issue Dec 23, 2019 · 1 comment · Fixed by #704
Closed

Metric can accept a dictionary #689

vfdev-5 opened this issue Dec 23, 2019 · 1 comment · Fixed by #704

Comments

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Dec 23, 2019

Idea is to simplify user code and add logic into Metric to accept engine's output as

output = {'y_pred': y_pred, 'y': y, ...}

Such that Metric can work on the output of the following formats:

  • (y_pred, y)
  • {'y_pred': y_pred, 'y': y, ...}

This could help to avoid writing output_transform adaptor.

@vfdev-5
Copy link
Collaborator Author

vfdev-5 commented Jan 12, 2020

I thought about automatically prepare output = {'y_pred': y_pred, 'y': y, ...} into output = (y_pred, y) between 118 and 119 if self._output_transform(engine.state.output) outputs a mapping.

def iteration_completed(self, engine):
output = self._output_transform(engine.state.output)
self.update(output)

@vfdev-5 vfdev-5 added this to To do in 0.3.0 via automation Jan 15, 2020
vfdev-5 added a commit to vfdev-5/ignite that referenced this issue Jan 15, 2020
- handles (y_pred, y) or {'y_pred': y_pred, 'y': y, ...} as output argument for update function
@vfdev-5 vfdev-5 mentioned this issue Jan 15, 2020
3 tasks
0.3.0 automation moved this from To do to Done Jan 15, 2020
vfdev-5 added a commit that referenced this issue Jan 15, 2020
* Fixes #689
- handles (y_pred, y) or {'y_pred': y_pred, 'y': y, ...} as output argument for update function

* Update documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
0.3.0
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant