the metric calculation for pytorch-lightning #13630
-
Generally, in pytorch-lightning, we use the step method for metric calculation, and the callback function monitors the metric of the step. I am curious how pytorch-lightning gets the metric of the epoch? Is it obtained by averaging? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Suppose I now have three batches of data: 20, 20, 10 (the last batch is not enough), and their accurate predictions are: 10 (10/20=0.5), 15 (15/20=0.75), and 5 (5/10=0.5). If we use the average method, the metric at this time: (0.5+0.75+0.5)/3 = 0.58. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if I'm misunderstanding, or if pytorch-lightning has an additional calculation? |
Beta Was this translation helpful? Give feedback.
-
it takes the weighted average using the current batch size. |
Beta Was this translation helpful? Give feedback.
it takes the weighted average using the current batch size.