Clipping values between -1 to 1 in the DDPM/DDIM scheduler. #492
-
Hello, hope you are doing well In this line, the sample is clipped between -1 to 1. However, in the tutorials, the values were normalized from 0 to 255 to 0 to 1. Is there any specific reason why the sampling was clipped between -1 to 1? If the dataset is normalized between 0 to 1, the predicted sample should also be clipped from 0 to 1. I would love to hear your opinion. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
me and @virginiafdez talked about allowing the user to pass the clipping values as args, i think this would solve the issue |
Beta Was this translation helpful? Give feedback.
-
I agree that the clipping value should be an argument. So far I haven't found a sound explanation as to why the prediction must be clipped (this comes from the SD implementation). It seems to make things more stable (especially for direct sample prediction). In latent diffusion models, it does not make sense to clip between -1 and 1 because the range of the latents should be ~ Gaussian (which are way below -1 and over 1). I have trained without clipping and still managed to get good results, which makes me think that, for noise prediction, clipping between -1 and 1 should not make it very different from clipping between 0 and 1. Nonetheless, I will allow for min and max clipping value specifications in an issue. |
Beta Was this translation helpful? Give feedback.
I agree that the clipping value should be an argument. So far I haven't found a sound explanation as to why the prediction must be clipped (this comes from the SD implementation). It seems to make things more stable (especially for direct sample prediction). In latent diffusion models, it does not make sense to clip between -1 and 1 because the range of the latents should be ~ Gaussian (which are way below -1 and over 1). I have trained without clipping and still managed to get good results, which makes me think that, for noise prediction, clipping between -1 and 1 should not make it very different from clipping between 0 and 1. Nonetheless, I will allow for min and max clipping value spe…