I’m asking: the metrics is calculated per batch, but I want the mse on the entire validation dataset. How do I do this? Do i have to store all the predictions somehow? How do I “store” them if so?

There is EpochMetric which computes a metric using user’s function on the entire history. https://pytorch.org/ignite/metrics.html#ignite.metrics.EpochMetric 6

This sounds like behind the scenes ignite figures out whether to hold on the the storage of the history of predictions or not.

Yes, each metric implementation know how to compute itself.


Does that mean that ignite’ MSE will automatically calculate the MSE on the entire validation set, not just one batch at a time?


Yes, MSE metric attached to an engine compute MSE on the entire input data.

#2) But how do I do it for a personal metric that ignite doesn’t have already?

See here : https://pytorch.org/ignite/metrics.html#how-to-create-a-custom-metric 2