Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Add Triplet loss function #31

Closed
wants to merge 1 commit into from
Closed

Add Triplet loss function #31

wants to merge 1 commit into from

Conversation

tanmayb123
Copy link
Contributor

No description provided.

@tanmayb123
Copy link
Contributor Author

One question: what should I call this? Is triplet just fine? Maybe tripletLoss?

@eaplatanios
Copy link
Contributor

I feel it's nice if we can add citations to the papers that introduced the various loss functions, layers, etc., whenever they're not one of the super standard/common ones.

@eaplatanios
Copy link
Contributor

@tanmayb123 Could you add a citation to this paper and also add the functional form of the loss in the documentation string?

@tanmayb123
Copy link
Contributor Author

Sure thing, but @rxwei had decided some time ago not to include loss functions that aren't available in Keras, but this PR stayed open. What should I do?

@rxwei
Copy link
Contributor

rxwei commented Jun 21, 2019

Let's add it for now!

@@ -53,3 +53,21 @@ public func sigmoidCrossEntropy<Scalar: TensorFlowFloatingPoint>(
(Tensor<Scalar>(1) - labels) * log(Tensor<Scalar>(1) - logits)
return -loss.mean(alongAxes: 0).sum()
}

/// Computes the triplet loss.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Computes the triplet loss.
/// Returns the triplet loss.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also add the citation as Anthony suggested.

@saeta
Copy link
Contributor

saeta commented Nov 7, 2019

Hi @tanmayb123 ! It looks like this PR is coming from an unknown repository. As a result, we'll close this out for now. But if you'd like to try and address the comments and add a test, I think we'd love to get this merged in.

All the best,
-Brennan

@saeta saeta closed this Nov 7, 2019
@Kshitij09
Copy link

Kshitij09 commented Mar 22, 2020

@tanmayb123 should I borrow your code and submit a new PR with requested changes? I was planning to submit a PR on your fork but seems like the branch having this code is missing.

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

Successfully merging this pull request may close these issues.

5 participants