This is a tensorflow implementation of margin based loss. See sampling matters in deep embedding learning. for references.
Distance weighted sampling method, distance weighted triplet loss and margin based loss are implemented in this code.
The author of the paper sampling matters in deep embedding learning
supplyed the
mxnet version.