Diffusion models#54
Conversation
… an unused import in diffusion_model.py
| if getattr(self.params, "diffusion", False): | ||
| logs = {'valid_EDMloss': torch.zeros(1).to(self.device), | ||
| 'valid_rmse': torch.zeros(1).to(self.device), | ||
| 'valid_nrmse': torch.zeros(1).to(self.device), | ||
| 'valid_l1': torch.zeros(1).to(self.device), | ||
| 'valid_ssim': torch.zeros(1).to(self.device)} | ||
| else: | ||
| logs = {'valid_rmse': torch.zeros(1).to(self.device), | ||
| 'valid_nrmse': torch.zeros(1).to(self.device), | ||
| 'valid_l1': torch.zeros(1).to(self.device), | ||
| 'valid_ssim': torch.zeros(1).to(self.device)} |
|
|
||
| x_next = init_inp * t_steps[0] | ||
|
|
||
| for i, (t_cur, t_next) in enumerate(zip(t_steps[:-1], t_steps[1:])): # 0, ..., N-1 |
There was a problem hiding this comment.
Could we wrap this denoising loop into a standalone function and move it to diffusion_model.py?
There was a problem hiding this comment.
I made a sampler class in generate.py so that it's easier to test other samplers if needed. I did not put it in diffusion_model.py because the sampler does not need to be tied to the diffusion model choice.
There was a problem hiding this comment.
Then maybe put it somewhere as a utils function? I'm thinking this piece of code is reusable generally.
There was a problem hiding this comment.
We can add a file for the sampler class. There are other samplers that can be included. I don't immediately see where these samplers could be used other than generating samples from score-based diffusion models though.
…irectory setting in submit_batch_generate.sh
…e embedding computation to basemodel.py




To be tested:
diffusionorcond_diffusionoptions turned offpersample_normalizeflag