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

Pairwise subpackage #553

Merged
merged 37 commits into from
Oct 14, 2021
Merged

Pairwise subpackage #553

merged 37 commits into from
Oct 14, 2021

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Sep 30, 2021

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

We already have a pairwise module in functional with a single function embedding_similarity. This PR expands with multiple new metrics (that also deprecates the embedding_similarity) so we have something that are much more similar to sklearns
pairwise metrics:
https://scikit-learn.org/stable/modules/metrics.html#metrics

Currently implements:

  • Cosine similarity
  • Linear similarity
  • euclidean distance
  • manhatten distance

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link

codecov bot commented Sep 30, 2021

Codecov Report

Merging #553 (51b81b4) into master (8bbc750) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #553   +/-   ##
=====================================
  Coverage      95%    95%           
=====================================
  Files         136    142    +6     
  Lines        4926   5004   +78     
=====================================
+ Hits         4681   4759   +78     
  Misses        245    245           

torchmetrics/functional/pairwise/cosine.py Outdated Show resolved Hide resolved
torchmetrics/functional/pairwise/cosine.py Outdated Show resolved Hide resolved
torchmetrics/functional/pairwise/cosine.py Outdated Show resolved Hide resolved
torchmetrics/functional/pairwise/euclidean.py Outdated Show resolved Hide resolved
torchmetrics/functional/pairwise/euclidean.py Outdated Show resolved Hide resolved
torchmetrics/functional/pairwise/cosine.py Outdated Show resolved Hide resolved
torchmetrics/functional/pairwise/euclidean.py Outdated Show resolved Hide resolved
torchmetrics/functional/pairwise/linear.py Show resolved Hide resolved
torchmetrics/functional/self_supervised.py Outdated Show resolved Hide resolved
tests/pairwise/test_pairwise_distance.py Outdated Show resolved Hide resolved
tests/pairwise/test_pairwise_distance.py Show resolved Hide resolved
torchmetrics/functional/pairwise/cosine.py Outdated Show resolved Hide resolved
@Borda Borda requested review from tchaton and Borda October 13, 2021 07:59
torchmetrics/functional/pairwise/cosine.py Outdated Show resolved Hide resolved
torchmetrics/functional/pairwise/cosine.py Outdated Show resolved Hide resolved
@mergify mergify bot added ready and removed has conflicts labels Oct 13, 2021
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
@Borda Borda enabled auto-merge (squash) October 14, 2021 12:05
@Borda Borda merged commit e1c3fda into master Oct 14, 2021
@Borda Borda deleted the pairwise branch October 14, 2021 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants