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 the loss function of Tf-reg KD #24

Open
HowieMa opened this issue Mar 7, 2021 · 1 comment
Open

Question about the loss function of Tf-reg KD #24

HowieMa opened this issue Mar 7, 2021 · 1 comment

Comments

@HowieMa
Copy link

HowieMa commented Mar 7, 2021

Hi, thank you for sharing such an awesome project.
For the TF-reg KD, in line 47 of my_loss_function.py, should we also divide the temperature T on the output variable, like:
loss_soft_regu = nn.KLDivLoss()(F.log_softmax(outputs / T, dim=1), F.softmax(teacher_soft/T, dim=1))*params.multiplier

As in Eq (9) of your paper, the loss function is $$D_{KL}(p^d_\tau, p_\tau)$$.

I would really appreciate it if you could help me. Look forward to your reply, thanks!

@DLoveS1314
Copy link

DLoveS1314 commented Apr 7, 2022

I am also very confused about this issue, looking forward to the author's answer
#19 answer your question

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