Skip to content

In 5.3 video 2 how is train_acc callable like a function #25

Discussion options

You must be logged in to vote

It's an object we instantiate from the Accuracy class, and then we assign it to an attribute of the LightningModel. The train_acc object then has a .forward() method that is executed when we call train_acc(...).
I have a blog article that might be helpful to understand what's happening: https://sebastianraschka.com/blog/2022/torchmetrics.html

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bonosa
Comment options

Answer selected by bonosa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants