Skip to content

To find r2score of my model #6125

Discussion options

You must be logged in to vote

I assume that you just want to calculate the total score, and in that case you should simply flatten your input before calculating the score:

from pytorch_lightning.metrics.functional import r2score
r2 = r2score(logits.flatten(), y.flatten())
self.log('r2:',r2)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bibinwils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants