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

"LocalNormalizedCrossCorrelationLoss" Docstring is Ambiguous #8350

Open
MrGranddy opened this issue Feb 18, 2025 · 0 comments
Open

"LocalNormalizedCrossCorrelationLoss" Docstring is Ambiguous #8350

MrGranddy opened this issue Feb 18, 2025 · 0 comments

Comments

@MrGranddy
Copy link
Contributor

MrGranddy commented Feb 18, 2025

Is your feature request related to a problem? Please describe.

The problem is about the docstring of "LocalNormalizedCrossCorrelationLoss" under losses.

  1. It is unclear if the returned value is in the range [-1, 1] as a standard correlation metric.
  2. It is not clear if the returned value will be negative or positive, also it is not clear if it is subject to minimization or maximization.

Let me elaborate on an example:

If for any project I want to increase the correlation between two images, I would calculate the correlation first then I would
negate it since the autograd library I would use would do minimization by default. Then I would also add +1 to it since
having negative loss terms when doing minimization is generally frowned upon, I am not sure for a good reason or not.

But this loss function directly returns a negative value, without going into the code it is not clear if this is because
the correlation is actually negative or not, should minimize or maximize the value, these are not at all clear and
absolutely can't be assumed, so this information should clearly be stated in the docstring, possibly with an additional
explanation like "smaller loss means high correlation" or as such.

Describe the solution you'd like

  1. In the docstring, state the range of the values that can be returned by the function if there is such a closed range.
  2. State the "real calculation" to "loss function" conversion steps, what is the actual correlation value, and what are you applying to it before returning (applying log, multiplying with -1, etc.). So that people can interpret what a high or low loss value actually means in terms of correlation.
  3. Optionally also state what a low or high loss value indicates in terms of correlation between the images for ease of usage.

Describe alternatives you've considered

I think there are endless ways of doing it, the main goal is clearing out any ambiguity, in whichever way possible. What I suggest seems reasonable to me.

Additional context
None

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

No branches or pull requests

1 participant