loss_sigmoid_focal_crossentropy | R Documentation |
Sigmoid focal crossentropy loss
loss_sigmoid_focal_crossentropy( from_logits = FALSE, alpha = 0.25, gamma = 2, reduction = tf$keras$losses$Reduction$NONE, name = "sigmoid_focal_crossentropy" )
from_logits |
If logits are provided then convert the predictions into probabilities |
alpha |
balancing factor. |
gamma |
modulating factor. |
reduction |
(Optional) Type of tf$keras$losses$Reduction to apply. Default value is SUM_OVER_BATCH_SIZE. |
name |
(Optional) name for the loss. |
Weighted loss float 'Tensor'. If 'reduction' is 'NONE',this has the same shape as 'y_true'; otherwise, it is scalar.
## Not run: keras_model_sequential() %>% layer_dense(4, input_shape = c(784)) %>% compile( optimizer = 'sgd', loss=loss_sigmoid_focal_crossentropy(), metrics='accuracy' ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.