MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / norm_thresholding

Function norm_thresholding

ldm/models/diffusion/sampling_util.py:14–16  ·  view source on GitHub ↗
(x0, value)

Source from the content-addressed store, hash-verified

12
13
14def norm_thresholding(x0, value):
15 s = append_dims(x0.pow(2).flatten(1).mean(1).sqrt().clamp(min=value), x0.ndim)
16 return x0 * (value / s)
17
18
19def spatial_norm_thresholding(x0, value):

Callers 1

Calls 1

append_dimsFunction · 0.85

Tested by

no test coverage detected