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

Add triplet margin loss #912

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add triplet margin loss #912

wants to merge 3 commits into from

Conversation

pglusacTT
Copy link
Contributor

Add support for triplet margin loss

Closes #911

@pglusacTT pglusacTT marked this pull request as ready for review December 16, 2024 15:00
@@ -119,3 +121,51 @@ def forward(self, predictions, labels):
square = Multiply("square", diff, diff)
loss = reduce_loss(self.reduction, square)
return loss


class TripletMarginLoss(ForgeModule):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: description

Copy link
Contributor

@pmarkovicTT pmarkovicTT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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

Successfully merging this pull request may close these issues.

TripletMarginLoss support
2 participants