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 implementation of calculating second-order derivative #1

Closed
kdwonn opened this issue Feb 15, 2021 · 2 comments
Closed

Comments

@kdwonn
Copy link

kdwonn commented Feb 15, 2021

First of all, thank you for the great PyTorch implementation.

But I can't get how the optimization procedure of the teacher network (eq.3 of the paper) is implemented.
The code should calculate the 2nd-order derivative during training, which is missing in the current version of the code.
Would you check the code again and let me know whether there is something I'm missing?

Thank you!

@kekmodel
Copy link
Owner

kekmodel commented Feb 16, 2021

First of all, thank you for the great PyTorch implementation.

But I can't get how the optimization procedure of the teacher network (eq.3 of the paper) is implemented.
The code should calculate the 2nd-order derivative during training, which is missing in the current version of the code.
Would you check the code again and let me know whether there is something I'm missing?

Thank you!

In the paper, eq.3 is eventually updated to eq.12. The dot product term of eq.12 is approximated by Taylor expansion according to the author's code. Please see the derivation of t_loss_mpl in my code.
https://github.com/google-research/google-research/blob/d4d85f5977ede30c77c96fdbf171027538b91bfc/meta_pseudo_labels/training_utils.py#L417-426
https://github.com/google-research/google-research/blob/d4d85f5977ede30c77c96fdbf171027538b91bfc/meta_pseudo_labels/training_utils.py#L473-496

@kdwonn
Copy link
Author

kdwonn commented Feb 18, 2021

That is a point I have missed. Thank you!

@kdwonn kdwonn closed this as completed Feb 18, 2021
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