Closed mathpluscode closed 3 years ago
Refactoring all loss functions is a lot of work. As for now we only consider dice score as a metric. I will close this issue and open a new one dedicate for dice and SSD.
Actually, i will do it in https://github.com/DeepRegNet/DeepReg/issues/735.
Subject of the issue
The implementations of loss and metric are different, i.e.
MSE loss https://github.com/tensorflow/tensorflow/blob/v2.4.1/tensorflow/python/keras/losses.py#L267-L322 MSE metric https://github.com/tensorflow/tensorflow/blob/v2.4.1/tensorflow/python/keras/metrics.py#L2378-L2410 They are different classes calling the same functions.
So we should refactor existing losses so that we can have the corresponding metrics without duplicated code
The concern is that: if we add a metric from a loss object, will that loss be automatically logged?