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

disc_param_avg #24

Open
TornadoM opened this issue Jun 21, 2017 · 2 comments
Open

disc_param_avg #24

TornadoM opened this issue Jun 21, 2017 · 2 comments

Comments

@TornadoM
Copy link

What is disc_param_avg used for here? Why its updates should be considered into parameters update. If gradients already be got by disc_param_updates, why couldn't we directly apply these gradients to the parameters in layers?

Thanks for your answer very much!

@christiancosgrove
Copy link

It seems that disc_param_avg could be used to calculate the "historical averaging" regularization term in both the discriminator and the generator's costs. See section 3.3 of https://arxiv.org/pdf/1606.03498.pdf

However, since disc_param_avg appears nowhere in the cost in this code, I don't think the authors have implemented historical averaging here.

Instead, I think disc_param_avg is just a temporally smoothed set of parameters. It's used at test time to give better, more stable results:

test_batch = th.function(inputs=[x_lab,labels], outputs=test_err, givens=disc_avg_givens)

https://github.com/openai/improved-gan/blob/master/mnist_svhn_cifar10/train_cifar_feature_matching.py#L104

@TornadoM
Copy link
Author

TornadoM commented Jun 23, 2017

@christiancosgrove Thanks very much for your explanation. Now I understand its function here. However, I thought it has been applied during the process.

train_batch_disc = th.function(inputs=[x_lab,labels,x_unl,lr], outputs=[loss_lab, loss_unl, train_err], updates=disc_param_updates+disc_avg_updates)

https://github.com/openai/improved-gan/blob/master/mnist_svhn_cifar10/train_cifar_feature_matching.py#L103

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