You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In diffusion it is common to want to clip samples to a desired range like [-1, 1], I think previous versions of this package supported this. However, the current implementation does not support this.
I think it would be useful to support clipping samples to a desired range.
VSampler
defforward(..., clip_denoised: bool=False, dynamic_threshold: float=0.0) ->Tensor:
...
x_pred=alphas[i] *x_noisy-betas[i] *v_pred# Add clipping support here ifclip_denoised:
clip(x_pred, dynamic_threshold=dynamic_threshold)
...
I am happy to open a PR if this is acceptable.
The text was updated successfully, but these errors were encountered:
Hey Kinyugo! Looks good to me. Only things is that dynamic thresholding is usually applied inside the sampling loop not only at the end. So a simple x_pred.clamp(-1,1) is probably enough -- I didn't transfer dynamic thresholding to v-diff since I'm not sure it would play well inside the sampling loop as we're not only predicting the ground truth like with normal or k-diff.
In diffusion it is common to want to clip samples to a desired range like
[-1, 1]
, I think previous versions of this package supported this. However, the current implementation does not support this.I think it would be useful to support clipping samples to a desired range.
VSampler
I am happy to open a PR if this is acceptable.
The text was updated successfully, but these errors were encountered: