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

FactorVAE encoder graph detaching during discriminator loss optimization #77

Open
willtop opened this issue Jul 24, 2024 · 0 comments
Open

Comments

@willtop
Copy link

willtop commented Jul 24, 2024

In FactorVAE, for the discriminator optimization, we don't want the gradients incurred in the VAE to update the VAE parameters, and thus the detach operation here:

z_perm = _permute_dims(latent_sample2).detach()

However, wouldn't we need to detach the first set of latent vectors as well (i.e. latent_sample1), now that we have to move the optimizer.step() at the end (due to the in-place modification error already addressed as one closed issue in the repo)?

I ran a debugging session and indeed gradient changes are observed on the VAE encoder from d_tc_loss.backward().

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

1 participant