if self.config.gammas is not None:
self.gammas = [
self.config.gammas[0],//torch.Tensor([self.config.gammas[0]]).float()[0].cuda(),//self.gan.configurable_param(self.config.gamma or 1.0)
self.config.gammas[1]//torch.Tensor([self.config.gammas[1]]).float()[0].cuda()//self.gan.configurable_param(self.config.gamma or 1.0)
]
self.relu = torch.nn.ReLU()
self.target = [Parameter(x, requires_grad=True) for x in self.gan.discriminator_real_inputs()]
self.x_mod_target = torch.zeros_like(self.target[0])
self.g_mod_target = torch.zeros_like(self.target[0])
def forward(self, d_loss, g_loss):
if self.config.mode == "real" or self.config.mode is None:
for target, data in zip(self.target, self.gan.discriminator_real_inputs()):
target.data = data.clone()
d_fake = self.gan.d_fake