MCPcopy
hub / github.com/ali-vilab/AnyDoor / q_sample

Method q_sample

ldm/models/diffusion/ddpm.py:356–359  ·  view source on GitHub ↗
(self, x_start, t, noise=None)

Source from the content-addressed store, hash-verified

354 return_intermediates=return_intermediates)
355
356 def q_sample(self, x_start, t, noise=None):
357 noise = default(noise, lambda: torch.randn_like(x_start))
358 return (extract_into_tensor(self.sqrt_alphas_cumprod, t, x_start.shape) * x_start +
359 extract_into_tensor(self.sqrt_one_minus_alphas_cumprod, t, x_start.shape) * noise)
360
361 def get_v(self, x, noise, t):
362 return (

Callers 13

p_lossesMethod · 0.95
log_imagesMethod · 0.95
ddim_samplingMethod · 0.45
forwardMethod · 0.45
p_lossesMethod · 0.45
progressive_denoisingMethod · 0.45
p_sample_loopMethod · 0.45
log_imagesMethod · 0.45
log_imagesMethod · 0.45
log_imagesMethod · 0.45
plms_samplingMethod · 0.45
ddim_samplingMethod · 0.45

Calls 2

defaultFunction · 0.90
extract_into_tensorFunction · 0.90

Tested by

no test coverage detected