taki0112 / StyleGAN-Tensorflow

Simple & Intuitive Tensorflow implementation of StyleGAN (CVPR 2019 Oral)
MIT License
211 stars 60 forks source link

Why not use tanh in the output layer of generator? #5

Closed weilinie closed 4 years ago

weilinie commented 5 years ago

If I understand correctly, the input images are normalized into [-1, 1] before feeding into the network. Why not use tanh in the output layer of generator to explicitly make fake images within the same range [-1, 1]?

capilano commented 4 years ago

They use a temporary RGB module after every stage, so I think putting an activation in that layer will probably hurt performance, because each time a layer is added the previous RGB module is bypassed, so the previous layer would have to re-adjust its weights to account for an lrelu activation in the first conv layer of the next stage, but if you just want to add a tanh in the very last layer, you can do it. I do not think its going to improve the quality of the images that much but also most likely won't hurt