diceCoeff(y_true, y_pred, smooth=1)¶
This function is used as the metric of similarity between the predicted mask and ground truth.
floats) – The true mask of the image
y_pred (numpy array of
floats) – the predicted mask of the data
int) – A parameter to ensure we are not dividing by zero and also a smoothing parameter for back -ropagation. If the prediction is hard threshold to 0 and 1, it is difficult to back-propagate the dice loss gradient. We add this parameter to actually smooth out the loss function, making it differentiable.
dice – Retuns the metric of similarity between prediction and ground truth
- Return type