MCPcopy Index your code
hub / github.com/VisionXLab/OF-Diff / q_sample

Method q_sample

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

Source from the content-addressed store, hash-verified

361 return_intermediates=return_intermediates)
362
363 def q_sample(self, x_start, t, noise=None):
364 noise = default(noise, lambda: torch.randn_like(x_start))
365 return (extract_into_tensor(self.sqrt_alphas_cumprod, t, x_start.shape) * x_start +
366 extract_into_tensor(self.sqrt_one_minus_alphas_cumprod, t, x_start.shape) * noise)
367
368 def get_v(self, x, noise, t):
369 return (

Callers 14

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