shadow2496 / WESPE

Moderate-Weight Implementation Code for "WESPE: Weakly Supervised Photo Enhancer for Digital Cameras"
MIT License
8 stars 1 forks source link

The output of the generator * 0.58 + 0.5 #2

Open ligua opened 5 years ago

ligua commented 5 years ago

May I ask why the output of the generator is multiplied with 0.58 , and then added by 0.5?

Thank you so much and best regards

shadow2496 commented 5 years ago

Thank you for using our repo and sorry for the late reply.

The architecture of generators in WESPE was adapted from DPED which is the authors' previous paper, and it uses nn.Tanh() as the last activation function. nn.Tanh() maps the resulting values into the range (-1, 1), but it should be (0, 1) to get images as an output, thus we use the formula nn.Tanh() * 0.58 + 0.5. The reason we multiply by 0.58 instead of 0.5 is that it has an effect of narrowing the range of possible input for nn.Tanh() and make the generators learn easily.

Below is a link you can refer: https://github.com/aiff22/DPED/issues/13