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

Fix the Kendalls Tau metric when used in graph mode #2739

Merged
merged 4 commits into from
Aug 5, 2022

Conversation

nicolaspi
Copy link
Contributor

@nicolaspi nicolaspi commented Aug 2, 2022

Description

Blocked by #2740

Brief Description of the PR:

The metric was only working in eager mode. This fix makes it work in graph mode too.

Type of change

  • Bug fix

Checklist:

  • I've properly formatted my code according to the guidelines
    • By running Black + Flake8
    • By running pre-commit hooks
  • This PR addresses an already submitted issue for TensorFlow Addons
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • This PR contains modifications to C++ custom-ops

How Has This Been Tested?

The metric was giving NaNs when running in graph mode. I modified the test to check against the NaN values.

@boring-cyborg boring-cyborg bot added the metrics label Aug 2, 2022
@bot-of-gabrieldemarmiesse

@sorensenjs

You are owner of some files modified in this pull request.
Would you kindly review the changes whenever you have the time to?
Thank you very much.

Copy link
Contributor

@sorensenjs sorensenjs left a comment

Choose a reason for hiding this comment

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

Looks great - thanks for this change.

sorensenjs
sorensenjs previously approved these changes Aug 2, 2022
@nicolaspi
Copy link
Contributor Author

I removed a padding op that seemed unnecessary.

@bhack
Copy link
Contributor

bhack commented Aug 3, 2022

@theadactyl Just another TF ecosystem duplication reminder, we have this also in TFP:
tensorflow/probability#1417

@sorensenjs
Copy link
Contributor

@theadactyl Just another TF ecosystem duplication reminder, we have this also in TFP: tensorflow/probability#1417

This is incorrect - the tfp implementation (1) can't be used as a keras metric (2) is not approximate. I'm the author of both, don't blame me for the complexities of TF packaging.

This particular implementation is an online O(n) approximate algorithm that is much better suited for use as a metric in machine learning. The TFP implementation is an O(n^2) algorithm.

@nicolaspi
Copy link
Contributor Author

nicolaspi commented Aug 3, 2022

The failing check looks to come from a regression in tensorflow_docs tensorflow/docs@eaef2e3 ? (See #2740)

@bhack
Copy link
Contributor

bhack commented Aug 3, 2022

The failing check looks to come from a regression in tensorflow_docs tensorflow/docs@eaef2e3 ?

/cc @MarkDaoust

@bhack
Copy link
Contributor

bhack commented Aug 5, 2022

@theadactyl Just another TF ecosystem duplication reminder, we have this also in TFP: tensorflow/probability#1417

This is incorrect - the tfp implementation (1) can't be used as a keras metric (2) is not approximate. I'm the author of both, don't blame me for the complexities of TF packaging.

This particular implementation is an online O(n) approximate algorithm that is much better suited for use as a metric in machine learning. The TFP implementation is an O(n^2) algorithm.

I was exactly referring to the ecosystem boundaries and packaging.

See our original 2020 thread:
#2169 (comment)

@bhack bhack merged commit c7c40a0 into tensorflow:master Aug 5, 2022
@nicolaspi nicolaspi deleted the kendalls_tau_fix branch August 5, 2022 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants