-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
noise = torch.randn_like(im).to(device)
t = torch.full((im.shape[0],), diffusion_config['num_timesteps']-1, device=device)
#t = torch.randint(0, diffusion_config['num_timesteps'], (im.shape[0],)).to(device)
xt = scheduler.add_noise(im, noise, t)
for i in tqdm(reversed(range(diffusion_config['num_timesteps']))):
# Get prediction of noise
noise_pred = model(xt, torch.as_tensor(i).unsqueeze(0).to(device))
# Use scheduler to get x0 and xt-1
xt, x0_pred = scheduler.sample_prev_timestep(xt, noise, torch.as_tensor(i).to(device))```
I used the xt from the forward process to replace the original random noise, and used the noise added during the forward process to replace the model's output for reverse sampling, in order to validate the reverse sampling process. However, my results are not ideal. Do you have any insights on this
Metadata
Metadata
Assignees
Labels
No labels