Skip to content

Add an explanation on how metrics work with engine #2437

@vfdev-5

Description

@vfdev-5

📚 Documentation

It is unclear for newcomers what does the code below from docs (for example, Accuracy)

metric = Accuracy()
metric.attach(default_evaluator, "accuracy")
y_true = torch.Tensor([1, 0, 1, 1, 0, 1])
y_pred = torch.Tensor([1, 0, 1, 0, 1, 1])
state = default_evaluator.run([[y_pred, y_true]])
print(state.metrics["accuracy"])

More precisely, it is unclear that the metric is computed online and at each iteration some internal variables are updated and on epoch completed metric value is computed.

For each metric docs, let's add a link on the explanation that we can add explicitly to https://pytorch.org/ignite/metrics.html

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions