Transfer timesteps to standard deviation. Args: t (Tensor): timesteps ranging from 0 to 1 Returns: Tensor: standard deviation ranging from sigma_min to sigma_max
(self, t)
| 169 | self.mode = mode |
| 170 | |
| 171 | def t_to_sigma(self, t): |
| 172 | """Transfer timesteps to standard deviation. |
| 173 | |
| 174 | Args: |
| 175 | t (Tensor): timesteps ranging from 0 to 1 |
| 176 | |
| 177 | Returns: |
| 178 | Tensor: standard deviation ranging from sigma_min to sigma_max |
| 179 | """ |
| 180 | return torch.exp(self.sigma_min_log + (self.sigma_max_log - self.sigma_min_log) * t) |
| 181 | |
| 182 | @torch.no_grad() |
| 183 | def add_noise(self, x, t, x_mask=None): |