pbaylies / stylegan-encoder

StyleGAN Encoder - converts real images to latent space
Other
740 stars 180 forks source link

Confusing description of stochastic clipping in the CLI #25

Closed jankrepl closed 5 years ago

jankrepl commented 5 years ago

Hey! First of all thank you for all the brilliant work on this project!

One thing that confused me was the description of the clipping_threshold in your encode_images.py CLI

Stochastic clipping of gradient values outside of this threshold

However this technique does not clip gradients - it clips the values of the optimized variable.

pbaylies commented 5 years ago

Good point @jankrepl -- that should be dlatent values here, not gradient values! If you've looked at the code or you know the technique, then you know what this does, but yes, if a value goes out of range (by default from [-2..2]), it gets assigned a random value within the valid range.

gsygsy96 commented 4 years ago

The clip operation inspired me a lot! Thanks all!