Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
14
def
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
19
def
spatial_norm_thresholding(x0, value):
Callers
1
get_x_prev_and_pred_x0
Method · 0.90
Calls
1
append_dims
Function · 0.85
Tested by
no test coverage detected