Avocodo-pytorch icon indicating copy to clipboard operation
Avocodo-pytorch copied to clipboard

why add detach() ?

Open manmaynakhashi opened this issue 2 years ago • 1 comments

why do you detach() https://github.com/rishikksh20/Avocodo-pytorch/blob/b298072e82a78b478697b30033ce4bfd20507634/train.py#L130 and not at https://github.com/rishikksh20/Avocodo-pytorch/blob/b298072e82a78b478697b30033ce4bfd20507634/train.py#L148 @rishikksh20

manmaynakhashi avatar Jan 27 '23 13:01 manmaynakhashi

The Collaborative Multi-Band Discriminator in the line 130 is for updating the discriminator only, we take the detach to do copy to new tensor so that the generator don't get gradient.

In the line 148, we will update gradient for the generator

image

v-nhandt21 avatar Mar 09 '23 12:03 v-nhandt21