View source: R/customMetrics.R
binary_dice_coefficient | R Documentation |
Note: Assumption is that y_true is not a one-hot representation of the segmentation batch. For use with e.g., sigmoid activation.
binary_dice_coefficient(y_true, y_pred, smoothingFactor = 0)
y_true |
True labels (Tensor) |
y_pred |
Predictions (Tensor of the same shape as |
smoothingFactor |
parameter for smoothing the metric. |
Dice value (negative)
Tustison NJ
library( ANTsR )
library( ANTsRNet )
library( keras )
model <- createUnetModel2D( c( 64, 64, 1 ) )
dice_loss <- binary_dice_coefficient( smoothingFactor = 0.1 )
model %>% compile( loss = dice_loss,
optimizer = optimizer_adam( lr = 0.0001 ) )
rm(model); gc()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.