MCPcopy Create free account
hub / github.com/294coder/Dif-PAN / get_model_input_time

Function get_model_input_time

solver/dpm_solver.py:279–288  ·  view source on GitHub ↗

Convert the continuous-time `t_continuous` (in [epsilon, T]) to the model input time. For discrete-time DPMs, we convert `t_continuous` in [1 / N, 1] to `t_input` in [0, 1000 * (N - 1) / N]. For continuous-time DPMs, we just use `t_continuous`.

(t_continuous)

Source from the content-addressed store, hash-verified

277 """
278
279 def get_model_input_time(t_continuous):
280 """
281 Convert the continuous-time `t_continuous` (in [epsilon, T]) to the model input time.
282 For discrete-time DPMs, we convert `t_continuous` in [1 / N, 1] to `t_input` in [0, 1000 * (N - 1) / N].
283 For continuous-time DPMs, we just use `t_continuous`.
284 """
285 if noise_schedule.schedule == 'discrete':
286 return (t_continuous - 1. / noise_schedule.total_N) * 1000.
287 else:
288 return t_continuous
289
290 def noise_pred_fn(x, t_continuous, cond=None):
291 t_input = get_model_input_time(t_continuous)

Callers 2

noise_pred_fnFunction · 0.85
model_fnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected