(self, x_start, t, noise)
| 1004 | #------------------------------------------ training ------------------------------------------# |
| 1005 | |
| 1006 | def q_sample(self, x_start, t, noise): |
| 1007 | sample = ( |
| 1008 | extract(self.sqrt_alphas_cumprod, t, x_start.shape) * x_start + |
| 1009 | extract(self.sqrt_one_minus_alphas_cumprod, t, x_start.shape) * noise |
| 1010 | ) |
| 1011 | return sample |
| 1012 | |
| 1013 | def p_losses(self, x_start_init, t, data_batch, aux_info={}): |
| 1014 | noise_init = torch.randn_like(x_start_init) |