MCPcopy Create free account
hub / github.com/Royalvice/DocDiff / noisy_image

Method noisy_image

schedule/diffusionSample.py:64–68  ·  view source on GitHub ↗

Compute y_noisy according to (6) p15 of [2]

(self, t, y)

Source from the content-addressed store, hash-verified

62 return xt_prev_mean, var
63
64 def noisy_image(self, t, y):
65 """ Compute y_noisy according to (6) p15 of [2]"""
66 noise = torch.randn_like(y)
67 y_noisy = extract_(self.sqrt_gammas, t, y.shape) * y + extract_(self.sqrt_one_minus_gammas, t, noise.shape) * noise
68 return y_noisy, noise
69
70 def forward(self, x_T, cond, pre_ori='False'):
71 """

Callers 1

forwardMethod · 0.80

Calls 1

extract_Function · 0.85

Tested by

no test coverage detected