AttGAN-PyTorch icon indicating copy to clipboard operation
AttGAN-PyTorch copied to clipboard

What's the meaning of inject_int and thres_int?

Open Ksky001 opened this issue 6 years ago • 1 comments

why use extra attr_a_ and attr_b_ for attr_a and attr_b?

Ksky001 avatar Dec 23 '19 14:12 Ksky001

The decoder of the generator takes a latent space tensor and a conditional attribute as its inputs. The attributes in CelebA dataset are 0 and 1. But we surmise that it would be better to have symmetric inputs like what we usually do to the images for GANs. We always normalize an images to (-1, 1) when doing the generative stuffs.

This line att_a_ = (att_a * 2 - 1) * thres_int has the same effect. The thres_int is the threshold intensity playing a role of a scaling factor. It is 0.5 by default. So the attributes, which are 0s and 1s, are hence normalized as (-0.5, 0.5).

Please let me know if you have any other questions.

elvisyjlin avatar Dec 24 '19 16:12 elvisyjlin