toward-controlled-generation-of-text-pytorch icon indicating copy to clipboard operation
toward-controlled-generation-of-text-pytorch copied to clipboard

Calculate the gradient of encoder in VAE correctly

Open GBLin5566 opened this issue 7 years ago • 1 comments

https://github.com/GBLin5566/toward-controlled-generation-of-text-pytorch/blob/master/train.py#L270-L274 Calculating the extra loss (Line 272) with vae loss(Line 274) would trace the gradient of the graph twice, as a result it triggers the error msg.

GBLin5566 avatar Dec 17 '17 10:12 GBLin5566

You got the retain_graph error right ? What happened when you just set it to true ?

jonzarecki avatar Dec 29 '17 12:12 jonzarecki