Skip to content

Gradients are backpropagated into Generator during Discriminator Training #39

@D-VR

Description

@D-VR

Hello, as far as I understand the code, it seems like during the training loop of Doppelganger, the gradients from the Generator forward step are not detached, meaning they get updated when the discriminator loss gets backpropagated. However Gen and Disc should be trained separately according to the Doppelganger architecture.

fake_attribute, _, fake_feature = self.generator(
real_attribute_noise,
addi_attribute_noise,
feature_input_noise,
h0,
c0
)

Proposed fix:

                        with torch.no_grad():
                            fake_attribute, _, fake_feature = self.generator.forward(
                                real_attribute_noise,
                                addi_attribute_noise,
                                feature_input_noise,
                                h0,
                                c0,
                            )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions