Unit 5, Exercise 2 #73
-
Hi @rasbt , Thank you for putting together the tutorial! lightning noob here, sorry if this is obvious. I tried changing the
I was surprised to see that that was not the case. IIUC, it should be a forward pass so either data is different or weights. I am assuming weights should not be different as they shouldn't be updated on a validation step and I can't see why data would be different as I have shuffle off.
Would appreciate your guidance on what I might be missing or if the behavior is what you would expect. metrics .csv produced from logging is also attached. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi there! This is actually a great observation. 100% agree with you that you'd expect 0%. The reason is a tiny implementation detail here. So, when you compute the classification accuracy on the training dataset during training, it is computing the accuracy on each batch. But then the model is updated after each batch. What I mean is, it's like follows:
This is a workaround because otherwise it would be too expensive to compute the accuracy after each epoch if the training set is very large. However, during validation, there you iterate through the dataset without updating the model. So yeah, that's likely where the discrepancy comes from. I hope that makes sense. And please let me know if that's confusing. It's a bit difficult to describe via text 😅 |
Beta Was this translation helpful? Give feedback.
Hi there! This is actually a great observation. 100% agree with you that you'd expect 0%. The reason is a tiny implementation detail here. So, when you compute the classification accuracy on the training dataset during training, it is computing the accuracy on each batch. But then the model is updated after each batch.
What I mean is, it's like follows:
This is a workaround because otherwise it would be too expensive to compute the accuracy after each epoch if the training set is very large.
However, during validation…