Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tfa.losses.TripletSemiHardLoss() replacement? #370

Open
mfide opened this issue Jan 11, 2024 · 2 comments
Open

tfa.losses.TripletSemiHardLoss() replacement? #370

mfide opened this issue Jan 11, 2024 · 2 comments

Comments

@mfide
Copy link

mfide commented Jan 11, 2024

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
Copy link

I am also wondering about this...

@ma7555
Copy link

ma7555 commented May 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants