Skip to content

loss_fun parameter validationf for entropic GW functions #515

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

Merged

Conversation

kachayev
Copy link
Collaborator

Types of changes

  • explicitly check if loss_fun given is valid for all GW functions that take such the argument
  • fix docstrings where it was still listed as a "callable" (not an option now, based on the code)
  • update tests to check for validation

Motivation and context / Related issue

Unified approach to handling loss_fun parameter for all GW-related functions. Cleaner error message.

Also, note that before the changes, oftentimes function relied on the validation to happen rather deep in the call stack, for example in init_matrix helper. Which seems rather fragile when making changes in high-level modules (e.g. another set of low-level procedures could be used).

How has this been tested (if it applies)

Test cases are updated.

PR checklist

  • I have read the CONTRIBUTING document.
  • The documentation is up-to-date with the changes I made (check build artifacts).
  • All tests passed, and additional code has been covered with new tests.
  • I have added the PR and Issue fix to the RELEASES.md file.

@codecov
Copy link

codecov bot commented Aug 26, 2023

Codecov Report

Merging #515 (2a74966) into master (7fa8438) will decrease coverage by 0.02%.
The diff coverage is 88.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #515      +/-   ##
==========================================
- Coverage   96.06%   96.05%   -0.02%     
==========================================
  Files          65       65              
  Lines       13706    13732      +26     
==========================================
+ Hits        13167    13190      +23     
- Misses        539      542       +3     

@agramfort agramfort merged commit 829ce41 into PythonOT:master Aug 27, 2023
@kachayev kachayev deleted the fix-entropic-gw-barycenter-loss-fn branch August 27, 2023 06:37
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.

2 participants