SemiSupervisedPytorchGAN icon indicating copy to clipboard operation
SemiSupervisedPytorchGAN copied to clipboard

Some question in your ipynb script

Open renzilin opened this issue 5 years ago • 0 comments

Dear Author, I'm a 2nd year PhD student in bioinformatics. I'm trying to learn the Semi-supervised GAN and apply it on medical data. I found your code here and read your ipynb script. Could you please help me with some questions in your code.

The question is mainly in calculating the loss in GAN. In your script, unlabelled loss is calculated by 0.5 * (-torch.mean(logz_unlabel) + torch.mean(F.softplus(logz_unlabel))), the fake loss is 0.5*torch.mean(F.softplus(logz_fake)) and the labelled is -torch.mean(prob_label) + torch.mean(logz_label). When training generator, the loss is 0.5 * (-torch.mean(logz_unlabel) + torch.mean(F.softplus(logz_unlabel))).

  1. Could you please explain what's the aim of 0.5 in torch.mean?
  2. What is the softplus for?

Thanks for your help!

Best, Zilin

renzilin avatar Jul 05 '20 21:07 renzilin