WLJS LogoWLJS Notebook

ContrastiveLossLayer

ContrastiveLossLayer[] represents a loss layer that computes a loss based on a distance metric and a target that specifies whether the distance should be minimized or maximized.

ContrastiveLossLayer[margin] specifies a distance above which the loss is zero for True targets.

Examples

Create a contrastive loss layer:

ContrastiveLossLayer[1.0]

Please visit the official Wolfram Language Reference for more details.

On this page