-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[pytorch] Add triplet margin loss with custom distance #43680
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
Conversation
Summary: As discussed [here](#43342), adding in a Python-only implementation of the triplet-margin loss that takes a custom distance function. Still discussing whether this is necessary to add to PyTorch Core. Test Plan: python test/run_tests.py Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 7756ad2 (more details on the Dr. CI page): ✅ None of the CI failures appear to be your fault 💚
❄️ 2 failures tentatively classified as flakybut reruns have not yet been triggered to confirm:
|
Summary: As discussed [here](#43342), adding in a Python-only implementation of the triplet-margin loss that takes a custom distance function. Still discussing whether this is necessary to add to PyTorch Core. Test Plan: python test/run_tests.py Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23363898](https://our.internmc.facebook.com/intern/diff/D23363898) [ghstack-poisoned]
Summary: As discussed [here](#43342), adding in a Python-only implementation of the triplet-margin loss that takes a custom distance function. Still discussing whether this is necessary to add to PyTorch Core. Test Plan: python test/run_tests.py Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: b62a832 Pull Request resolved: #43680
Summary: As discussed [here](#43342), adding in a Python-only implementation of the triplet-margin loss that takes a custom distance function. Still discussing whether this is necessary to add to PyTorch Core. Test Plan: python test/run_tests.py Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23363898](https://our.internmc.facebook.com/intern/diff/D23363898) [ghstack-poisoned]
Summary: As discussed [here](#43342), adding in a Python-only implementation of the triplet-margin loss that takes a custom distance function. Still discussing whether this is necessary to add to PyTorch Core. Test Plan: python test/run_tests.py Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 14fbd6d Pull Request resolved: #43680
Summary: As discussed [here](#43342), adding in a Python-only implementation of the triplet-margin loss that takes a custom distance function. Still discussing whether this is necessary to add to PyTorch Core. Test Plan: python test/run_tests.py Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23363898](https://our.internmc.facebook.com/intern/diff/D23363898) [ghstack-poisoned]
Summary: As discussed [here](#43342), adding in a Python-only implementation of the triplet-margin loss that takes a custom distance function. Still discussing whether this is necessary to add to PyTorch Core. * Consolidate tests, clarify functional limitations * Documentation updates * Remove stray imports * Fix CI Test Plan: python test/run_tests.py Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: a4e87fa Pull Request resolved: #43680
|
Looks like all CI tests are passing except for a couple (flaky-esque?) windows failures -- is this expected/is there a way to tell if something is broken upstream? |
Yep. Sorry for the confusion. Windows CI is broken at the moment and we're working on a fix. You can ignore those failures ;) |
|
Cool -- in that case, I think this is ready. What steps do I have to complete on my end for the merge? (if it's preferable, I'm totally fine with waiting until a non-Friday afternoon to merge this too) |
You don't need to do anything at this point. We take it from here. |
Summary: As discussed [here](#43342), adding in a Python-only implementation of the triplet-margin loss that takes a custom distance function. Still discussing whether this is necessary to add to PyTorch Core. Test Plan: python test/run_tests.py Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23363898](https://our.internmc.facebook.com/intern/diff/D23363898) [ghstack-poisoned]
Summary: As discussed [here](#43342), adding in a Python-only implementation of the triplet-margin loss that takes a custom distance function. Still discussing whether this is necessary to add to PyTorch Core. * Consolidate tests, clarify functional limitations * Documentation updates * Remove stray imports * Fix CI Test Plan: python test/run_tests.py Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 7052170 Pull Request resolved: #43680
|
This is now merged, congrats @ethch18! This is a cool module. |
|
Thanks @mruberry and @albanD! Appreciate the mentorship and guidance. Curious what your thoughts are on the C++ side of this -- I had PR #44072 open as a proof-of-concept but that's pretty out of date at this point. If there's a need, I can continue working on this over the next month or so, or I could hand it off to someone else if that's preferable. |
|
@glaringlee is our C++ API czar. We do like to keep the C++ API consistent with the Python API and would definitely accept a PR implementing this module in C++. |
|
This pull request has been merged in ef885c1. |
|
This pull request has been merged in ef885c1. |
|
@glaringlee sure, thanks for reviewing this!. PR #44072 is out of date -- had quite a few changes made here that weren't reflected there. I don't have time at the moment but will tidy it up once I have a chance and ping you in the comments there. |
Summary: As discussed [here](pytorch/pytorch#43342), adding in a Python-only implementation of the triplet-margin loss that takes a custom distance function. Still discussing whether this is necessary to add to PyTorch Core. * Consolidate tests, clarify functional limitations * Documentation updates * Remove stray imports * Fix CI Test Plan: python test/run_tests.py Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 672055f Pull Request resolved: pytorch/pytorch#43680
This PR adds a C++ implementation of the TripletMarginWithDistanceLoss, for which the Python implementation was introduced in PR #43680. It's based on PR #44072, but I'm resubmitting this to unlink it from Phabricator. cc: @mruberry @albanD @glaringlee [ghstack-poisoned]
This PR adds a C++ implementation of the TripletMarginWithDistanceLoss, for which the Python implementation was introduced in PR #43680. It's based on PR #44072, but I'm resubmitting this to unlink it from Phabricator. cc: @mruberry @albanD @glaringlee [ghstack-poisoned]
This PR adds a C++ implementation of the TripletMarginWithDistanceLoss, for which the Python implementation was introduced in PR #43680. It's based on PR #44072, but I'm resubmitting this to unlink it from Phabricator. cc: @mruberry @albanD @glaringlee [ghstack-poisoned]
This PR adds a C++ implementation of the TripletMarginWithDistanceLoss, for which the Python implementation was introduced in PR #43680. It's based on PR #44072, but I'm resubmitting this to unlink it from Phabricator. cc: @mruberry @albanD @glaringlee [ghstack-poisoned]
This PR adds a C++ implementation of the TripletMarginWithDistanceLoss, for which the Python implementation was introduced in PR #43680. It's based on PR #44072, but I'm resubmitting this to unlink it from Phabricator. cc: @mruberry @albanD @glaringlee [ghstack-poisoned]
This PR adds a C++ implementation of the TripletMarginWithDistanceLoss, for which the Python implementation was introduced in PR #43680. It's based on PR #44072, but I'm resubmitting this to unlink it from Phabricator. cc: @mruberry @albanD @glaringlee [ghstack-poisoned]
Summary: Pull Request resolved: #45377 This PR adds a C++ implementation of the TripletMarginWithDistanceLoss, for which the Python implementation was introduced in PR #43680. It's based on PR #44072, but I'm resubmitting this to unlink it from Phabricator. Test Plan: Imported from OSS Reviewed By: izdeby Differential Revision: D24003973 fbshipit-source-id: 2d9ada7260a6f27425ff2fdbbf623dad0fb79405
Stack from ghstack:
Summary: As discussed here,
adding in a Python-only implementation of the triplet-margin loss that takes a
custom distance function. Still discussing whether this is necessary to add to
PyTorch Core.
Test Plan: python test/run_tests.py
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D23363898