You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear authors,
Thank you for generously sharing your great work!
I used dpm-solver to accelerate vanilla ddpm for image purification.And if I set timesteps OF DDPM as 500,with my pretrained model,I can gradually reverse the image to one that's close to the original one:
However,when I used dpm-solver,the results are blurry:
Settings:
512*512 celebahq;
betas are from 0.0001 to 01004004 with 500 steps,so x_start=1,x_end=1/500;
self.model:the same one in your responsitory,whose path is "dpm-solver/examples/ddpm_and_guided-diffusion/models
/diffusion.py"
Thanks for your quick response!
The loss is the squared difference between the predicted noise and the real noise added in step t-1;
I used the pretrained model of this repo,which claims that it's a copy from SDEdit.So it should be trained with code below from this PyTorch implementation for training the model according to its readme:(comments are added by me)
def noise_estimation_loss(model,
x0: torch.Tensor, //image used for training
t: torch.LongTensor, //timestep
e: torch.Tensor,// random noise having shape of x0
b: torch.Tensor, //self.betas
keepdim=False):
a = (1-b).cumprod(dim=0).index_select(0, t).view(-1, 1, 1, 1)
x = x0 * a.sqrt() + e * (1.0 - a).sqrt()// image after adding t steps of noise
output = model(x, t.float()) //the predicted noise added by step t-1
if keepdim:
return (e - output).square().sum(dim=(1, 2, 3))//the difference between predicted noise and real noise
else:
return (e - output).square().sum(dim=(1, 2, 3)).mean(dim=0)
loss_registry = {
'simple': noise_estimation_loss,
}
ps:I found this copy in SDEdit‘s issuse because the pretrained model in it cannot be accessed,and it worked fine in vanilla DDPM as a NOISE PREDICTION MODEL.
Thanks again for your kind help!It means a lot to me!
Dear authors,
![image](https://private-user-images.githubusercontent.com/94369171/311442163-25e0d0c8-0ea7-4396-88ca-69f3cc5b0ac7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNDc1NzcsIm5iZiI6MTcyNj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N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM0NDU2YjBiYmM0NzMwOWQ3NjFhYjE0N2Q5NzdjYzExYzU4MTRiOTY2NWM5ZjIyOTE5MzUzYjVmY2Y3YjczYzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.GJ4PsfDYR_hOdj95t60TF0xjBqS14BujhELzu2GwJg4)
Thank you for generously sharing your great work!
I used dpm-solver to accelerate vanilla ddpm for image purification.And if I set timesteps OF DDPM as 500,with my pretrained model,I can gradually reverse the image to one that's close to the original one:
However,when I used dpm-solver,the results are blurry:
Settings:
512*512 celebahq;
betas are from 0.0001 to 01004004 with 500 steps,so x_start=1,x_end=1/500;
self.model:the same one in your responsitory,whose path is "dpm-solver/examples/ddpm_and_guided-diffusion/models
/diffusion.py"
noise_schedule = NoiseScheduleVP(schedule='discrete', betas=self.betas) model_fn = model_wrapper( self.model, noise_schedule, model_type="noise", model_kwargs={}, guidance_type="uncond" )
self.dpm_solver = DPM_Solver(model_fn, noise_schedule, algorithm_type="dpmsolver++") x_sample = self.dpm_solver.sample( x, steps=20, order=3, skip_type="time_uniform", method="singlestep"
I tried singlestep,multistep,steps ranging [10,1000],orders as 1,2 or 3.Nothing worked.
Thanks for your kind help!
The text was updated successfully, but these errors were encountered: