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

Method predict_start_from_z_and_v

ldm/models/diffusion/ddpm.py:297–303  ·  view source on GitHub ↗
(self, x_t, t, v)

Source from the content-addressed store, hash-verified

295 )
296
297 def predict_start_from_z_and_v(self, x_t, t, v):
298 # self.register_buffer('sqrt_alphas_cumprod', to_torch(np.sqrt(alphas_cumprod)))
299 # self.register_buffer('sqrt_one_minus_alphas_cumprod', to_torch(np.sqrt(1. - alphas_cumprod)))
300 return (
301 extract_into_tensor(self.sqrt_alphas_cumprod, t, x_t.shape) * x_t -
302 extract_into_tensor(self.sqrt_one_minus_alphas_cumprod, t, x_t.shape) * v
303 )
304
305 def predict_eps_from_z_and_v(self, x_t, t, v):
306 return (

Callers 2

p_sample_ddimMethod · 0.80
p_sample_ddimMethod · 0.80

Calls 1

extract_into_tensorFunction · 0.90

Tested by

no test coverage detected