Implement the -family of DDIM samplers (Song et al., 2021) that share one DDPM-trained noise predictor.
ddim_timesteps(T, S, spacing="linear")
S increasing ints in [0, T-1]: "linear" rounds np.linspace(0, T-1, S) to the nearest integer; "quadratic" rounds np.linspace(0, sqrt(T-1), S) ** 2. Raise ValueError for any other spacing.ddim_sigma(a_t, a_prev, eta)
ddim_step(x_t, eps, a_t, a_prev, eta, rng=None)
z = rng.standard_normal(x_t.shape) only when ; with eta = 0 never touch rng.ddim_sample(x_T, eps_model, alpha_bar, timesteps, eta, rng=None)
alpha_bar has shape (T,); eps_model(x, t) returns the noise estimate at integer t.timesteps from largest to smallest, calling eps_model exactly once per timestep and applying ddim_step with a_t = alpha_bar[t] and a_prev = alpha_bar[t_prev], t_prev being the next smaller timestep; for the smallest timestep use a_prev = 1.0.x_T).