Have an example of showing explicitly how to calculate metrics in DDP
🚀 Feature
Given the new updates in 0.9.0, it is desirable to have an example of showing exactly and explicitly how to calculate metrics in DDP. The metrics of interest are those that requires all the labels and prediction for an entire epoch, such as F1 score or average precision.
Motivation
As a big fan of this project and a data scientist who already used Lightning in my work, I am still not sure if I have done metrics in DDP correctly or not. While it is easy to spot some obvious mistakes in F1 if the calculated F1 goes over 1 (by definition, F1 is between 0 and 1 and would never go above 1) with DDP, it is hard to know for sure if this is calculated correctly as there is no official document detailing how to do that exactly. Having the proposed example would greatly boost the adoption of Lightning in the PyTorch community.
Pitch
Have an example of calculating metrics such as F1 in DDP
Alternatives
Additional context
There are many issues related to calculating metrics in DDP and honestly this could be the most challenging part for further adoption. Having the proposed example will greatly help in this regard.