Skip to contents

Contrastive loss as used here: https://keras.io/examples/vision/siamese_contrastive/.

Usage

loss_cl(margin = 1)

Arguments

margin

Integer, baseline for distance for which pairs should be classified as dissimilar.

Value

A function implementing contrastive loss.

Examples

if (FALSE) { # reticulate::py_module_available("tensorflow")
cl <- loss_cl(margin=1)
}