Deep learning framework by BAIR
Created by
Yangqing Jia
Lead Developer
Evan Shelhamer
ContrastiveLoss
./include/caffe/layers/contrastive_loss_layer.hpp
./src/caffe/layers/contrastive_loss_layer.cpp
./src/caffe/layers/contrastive_loss_layer.cu
ContrastiveLossParameter contrastive_loss_param
)./src/caffe/proto/caffe.proto
):message ContrastiveLossParameter {
// margin for dissimilar pair
optional float margin = 1 [default = 1.0];
// The first implementation of this cost did not exactly match the cost of
// Hadsell et al 2006 -- using (margin - d^2) instead of (margin - d)^2.
// legacy_version = false (the default) uses (margin - d)^2 as proposed in the
// Hadsell paper. New models should probably use this version.
// legacy_version = true uses (margin - d^2). This is kept to support /
// reproduce existing models and results
optional bool legacy_version = 2 [default = false];
}