In 5.3 video 2 how is train_acc callable like a function #25
Answered
by
rasbt
bonosa
asked this question in
Lecture videos and quizzes
-
if it's an attribute? chatGPT says it's not a regular attribute but an instance of the Accuracy class from torchmetrics. Is that correct? |
Beta Was this translation helpful? Give feedback.
Answered by
rasbt
Mar 18, 2023
Replies: 1 comment 1 reply
-
It's an object we instantiate from the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
bonosa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's an object we instantiate from the
Accuracy
class, and then we assign it to an attribute of theLightningModel
. Thetrain_acc
object then has a.forward()
method that is executed when we calltrain_acc(...)
.I have a blog article that might be helpful to understand what's happening: https://sebastianraschka.com/blog/2022/torchmetrics.html