Skip to content

Second forward pass in the training loop #12

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

Open
krips89 opened this issue Oct 8, 2020 · 2 comments
Open

Second forward pass in the training loop #12

krips89 opened this issue Oct 8, 2020 · 2 comments

Comments

@krips89
Copy link

krips89 commented Oct 8, 2020

Hello author, thanks for trying to recreate the paper's work. I have the following question.

In the training code, there are two call to the forward pass (before updating gradients to the Discriminator and the Generator). I am wondering why is it needed. The following block is called 2 times.

    `structure1, texture1 = encoder(real_img1)
    _, texture2 = encoder(real_img2)

    fake_img1 = generator(structure1, texture1)
    fake_img2 = generator(structure1, texture2)`

Even if the encoder/decoder's gradient update is disabled, that doesn't change the value of the forward pass. Am I missing something?

@rosinality
Copy link
Owner

You can may use retain_graph=True and reuse first graph constructed. I remember efficiency was similar.

@krips89
Copy link
Author

krips89 commented Oct 9, 2020

Exactly. Thanks.

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