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
#> Error in py_discover_config(required_module, use_environment): Python specified in RETICULATE_PYTHON (/Users/ntustison/anaconda3/envs/antsx/bin/python3) does not existdice_loss <- binary_dice_coefficient( smoothingFactor = 0.1 ) model %>% compile( loss = dice_loss, optimizer = optimizer_adam( lr = 0.0001 ) )#> Error in compile(., loss = dice_loss, optimizer = optimizer_adam(lr = 1e-04)): object 'model' not found#> Warning: object 'model' not found#> used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) #> Ncells 2488151 132.9 4570014 244.1 NA 4570014 244.1 #> Vcells 4379727 33.5 10146329 77.5 65536 6511633 49.7