priscacheese:

My idea was to use accuracy_temp to compute the average accuracy over each batch and then sum over all the computed accuracy_temp and divide by the number of batches (which I thought to be equal to len(dataloader)) to compute the overall accuracy.





 priscacheese:

I think that if the network predicted half of the elements in every batch correctly, I would get 0.5 as accuracy as expected,


You can easily check this assumption by working out the numbers by hand  for a simplified scenario: there are a 1000 inputs in total, which are split into 2 equal-sized batches with a 500 elements in each batch, and in each batch the network predicts half of the values correctly. What is the accuracy that will be reported in this case, if you follow your scheme? Does this match what you expected it to be? Does this correctly reflect how good the network is?