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

Function get_model_input_time

ldm/models/diffusion/dpm_solver/dpm_solver.py:246–255  ·  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

244 """
245
246 def get_model_input_time(t_continuous):
247 """
248 Convert the continuous-time `t_continuous` (in [epsilon, T]) to the model input time.
249 For discrete-time DPMs, we convert `t_continuous` in [1 / N, 1] to `t_input` in [0, 1000 * (N - 1) / N].
250 For continuous-time DPMs, we just use `t_continuous`.
251 """
252 if noise_schedule.schedule == 'discrete':
253 return (t_continuous - 1. / noise_schedule.total_N) * 1000.
254 else:
255 return t_continuous
256
257 def noise_pred_fn(x, t_continuous, cond=None):
258 if t_continuous.reshape((-1,)).shape[0] == 1:

Callers 2

noise_pred_fnFunction · 0.85
model_fnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected