def contrastive_loss(y_true, y_pred):
    margin = 1
    return K.mean(y_true * K.square(y_pred) + (1 - y_true) * K.square(K.maximum(margin - y_pred, 0)))
The project URL.
dataset/ETHPy150Open fchollet/keras/examples/mnist_siamese_graph.py/contrastive_loss--crossover with--dataset/ETHPy150Open libyal/libyal/data/scripts/setup.py/ProjectInformation.project_url