We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is referring to: https://github.com/t-vi/pytorch-tvmisc/blob/master/misc/gradient_regularized_gan_gaussian_toy_problem.ipynb
grads = torch.autograd.grad(scores, discriminator.parameters(), retain_graph=True, create_graph=True) gr_norm_sq = 0.0 for gr in grads: gr_norm_sq += (gr**2).sum()
grads_norm_penalty = ( torch.concat( [g.view(-1) for g in grads] ) .norm(p=2) )
What is your opinion on this? This tries to batch operations as much as possible.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This is referring to: https://github.com/t-vi/pytorch-tvmisc/blob/master/misc/gradient_regularized_gan_gaussian_toy_problem.ipynb
Current Code
Suggestion
Question
What is your opinion on this? This tries to batch operations as much as possible.
The text was updated successfully, but these errors were encountered: