https://github.com/nixtla logo
a

Ada Puślecka

08/25/2023, 12:19 PM
Hi, in the documentation I can read that the loss can be "PyTorch module, instantiated train loss class from losses collection" - is there any way to define your own custom metric or it must be one of the predefined metrics from your losses collection? I currently use custom metric which is a subclass of
torchmetrics.metric.Metric
and thinking if it would be possible to use that.
c

Cristian (Nixtla)

08/25/2023, 1:42 PM
Hi @Ada Puślecka. You can define your own custom metric, but there are some requirements. We recently refactored the losses and created a
BasePointLoss
to facilitate adding more losses. Here is the
MSE
loss based on the new class.
Your loss needs to have the init and call methods, and support using a
mask
. Let me know if you have particular doubts on how to create your loss.