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

About TV loss #8

Closed
mountains-high opened this issue Jul 14, 2022 · 4 comments
Closed

About TV loss #8

mountains-high opened this issue Jul 14, 2022 · 4 comments

Comments

@mountains-high
Copy link

Hi~
Thank you for this great work.

My question is about the TV loss. Could you give the reason why you took mean while calculating the TV loss?
The paper about that work did not mention the 'mean'. Thank you

diff3.abs() / 255.0).mean() + (diff4.abs() / 255.0).mean()

@VainF
Copy link
Contributor

VainF commented Jul 14, 2022

Hi @mountains-high, diff1-4 measure the pixel-wise gradient in four directions. So we reduce these gradients to a scalar value for training.

@mountains-high
Copy link
Author

Good day ~

Thank you for your reply, I got the point about the diff 1-4, however, didn't understand the taking "mean" of them. I found these lines in the paper Data-free Knowledge Distillation for Object Detection

image

According to equation 4 which they(the same authors) say that used on [44] isn't there to be 1/N if we consider the mean?
What do you think about it?

Thank you

@VainF
Copy link
Contributor

VainF commented Jul 15, 2022

Yes as you mentioned, the only difference between mean and sum lies in the scaling factor 1/N. You can adjust the their weight to get the same loss during training. In other word, if you want to use the summed TV loss, you need to lower down the weight of $\mathcal{L}_{TV}$ by N$\times$. However, there is not too much difference from the perspective of training.

@mountains-high
Copy link
Author

Good day~
Thank you for the answer

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

2 participants