The clip operation here is done before optimizerD.step(). So the discriminator used in updating G is the un-clampped version, which is not consistent with the paper.
Exactly! This seems to be an error in the code. I wonder if the difficulties that people have encountered in training WGANs is because of this error. Have you heard back from the authors?
The clip operation here is done before
optimizerD.step()
. So the discriminator used in updating G is the un-clampped version, which is not consistent with the paper.