Skip to content

The reverse sampling results are not ideal #9

@2000lf

Description

@2000lf
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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions