agrimgupta92 / sgan

Code for "Social GAN: Socially Acceptable Trajectories with Generative Adversarial Networks", Gupta et al, CVPR 2018
MIT License
813 stars 261 forks source link

y_fake = torch.zeros_like(scores_fake) * random.uniform(0, 0.3) #34

Closed mingbocui closed 5 years ago

mingbocui commented 5 years ago

the function gan_d_loss(scores_real, scores_fake) in the losses.py, is that a mistake we set y_fake = torch.zeros_like(scores_fake) random.uniform(0, 0.3)? Because we always got zero there is no meaning for us to multiply a random number. Or this should be y_fake = torch.ones_like(scores_fake) random.uniform(0, 0.3)? full code: ` def gan_d_loss(scores_real, scores_fake):

y_real = torch.ones_like(scores_real) * random.uniform(0.7, 1.2)
y_fake = torch.zeros_like(scores_fake) * random.uniform(0, 0.3)
loss_real = bce_loss(scores_real, y_real)
loss_fake = bce_loss(scores_fake, y_fake)
return loss_real + loss_fake

`

amiryanj commented 5 years ago

@mingbocui I think you're right, and that's a mistake in the code. To train a GAN you can use uniform random numbers between 0 and 0.3 as "Soft" False labels and etc (not sure how effective it would be).