Convert PyTorch loss to torchmetric Metric? #670
Unanswered
charlesbmi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm interested in using a
Metric
like Poisson negative log likelihood loss, which is already implemented in PyTorch as aModule
.Is there a helper-class to wrap existing PyTorch losses in a torchmetric
Metric
?In particular, I would like to store and log the best epoch-accumulated loss so far (similar to this example with
Accuracy
: https://github.com/ashleve/lightning-hydra-template/blob/main/src/models/mnist_model.py#L93-L96). I looked at theMeanSquaredError
source code as an example and know that I can re-implement aMetric
, but seems like it could be nice to be able to easily wrap a PyTorch loss in aMetric
class. Thanks!Beta Was this translation helpful? Give feedback.
All reactions