MCPcopy Create free account
hub / github.com/Zhiyuan-R/Tiger-Diffusion / constrain_fn

Function constrain_fn

test_generation.py:369–375  ·  view source on GitHub ↗
(x, t)

Source from the content-addressed store, hash-verified

367 # eps_all = list(reversed(np.linspace(0,np.float_power(eps, 1/2), 500)**2))
368 eps_all = list(reversed(np.linspace(0, np.sqrt(eps), 1000)**2 ))
369 def constrain_fn(x, t):
370 eps_ = eps_all[t] if (t<1000) else 0
371 for _ in range(num_steps):
372 x = x - eps_ * ((x - ground_truth) * mask)
373
374
375 return x
376 return constrain_fn
377
378

Callers 2

p_sample_loopMethod · 0.85
reconstructMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected