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

Question about computing loss in the code #4

Open
cooma04 opened this issue Oct 27, 2023 · 0 comments
Open

Question about computing loss in the code #4

cooma04 opened this issue Oct 27, 2023 · 0 comments

Comments

@cooma04
Copy link

cooma04 commented Oct 27, 2023

Hi, authors.
Thank you for the great work. I really enjoyed reading through your work.

In the mean time, I got a question on the loss function (in the code).
From the paper, the MFM computes losses on real and imaginary part of frequency representations between the prediction and target.
Now, my question is in your code (line 64 and 65 in frequency_loss.py), you are doing

tmp = (recon_freq - real_freq) ** 2
loss = torch.sqrt(tmp[..., 0] + tmp[..., 1] + 1e-12) ** self.loss_gamma, given recon_freq and real_freq are tensors of complex number of shape (NxPxCxHxW).

Then, what would "tmp[..., 0] + tmp[..., 1]" mean?
Are you computing the loss only over the first and second elements of W dimension?

Please correct me if I am misunderstanding anything from your code above.

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