tensorflow / similarity

TensorFlow Similarity is a python package focused on making similarity learning quick and easy.
Apache License 2.0
1.01k stars 104 forks source link

tfa.losses.TripletSemiHardLoss() replacement? #370

Open mfide opened 10 months ago

mfide commented 10 months ago

Hello,

I was using triplet loss function from tensorflow_addons.losses.TripletSemiHardLoss(margin=1.0) to train my model using following line:

tsn.compile(optimizer=tf.keras.optimizers.Adam(0.0001), loss=tfa.losses.TripletSemiHardLoss(margin=1.0))

Any example or idea how to replace this loss function with tripletloss in tensorflow_similarity.losses?

Thank you.

mhyeonsoo commented 8 months ago

I am also wondering about this...

ma7555 commented 7 months ago

tfsim.losses.TripletLoss(distance='l2', positive_mining_strategy='hard', negative_mining_strategy='semi-hard', margin=1.0)