Update README.md
This commit is contained in:
parent
162035e94d
commit
449fffed96
|
@ -55,7 +55,7 @@ num_prediction_steps = len(noise_scheduler)
|
|||
for t in tqdm.tqdm(reversed(range(num_prediction_steps)), total=num_prediction_steps):
|
||||
# predict noise residual
|
||||
with torch.no_grad():
|
||||
residual = unet(image, t)
|
||||
residual = unet(image, t)
|
||||
|
||||
# predict previous mean of image x_t-1
|
||||
pred_prev_image = noise_scheduler.compute_prev_image_step(residual, image, t)
|
||||
|
@ -63,8 +63,8 @@ for t in tqdm.tqdm(reversed(range(num_prediction_steps)), total=num_prediction_s
|
|||
# optionally sample variance
|
||||
variance = 0
|
||||
if t > 0:
|
||||
noise = noise_scheduler.sample_noise(image.shape, device=image.device, generator=generator)
|
||||
variance = noise_scheduler.get_variance(t).sqrt() * noise
|
||||
noise = noise_scheduler.sample_noise(image.shape, device=image.device, generator=generator)
|
||||
variance = noise_scheduler.get_variance(t).sqrt() * noise
|
||||
|
||||
# set current image to prev_image: x_t -> x_t-1
|
||||
image = pred_prev_image + variance
|
||||
|
|
Loading…
Reference in New Issue