Get the distribution q(x_t | x_0). :param x_start: the [N x C x ...] tensor of noiseless inputs. :param t: the number of diffusion steps (minus 1). Here, 0 means one step. :return: A tuple (mean, variance, log_variance), all of x_start's shape.
(self, x_start, t)
| 277 | print(f"\nUnexpected Keys:\n {unexpected}") |
| 278 | |
| 279 | def q_mean_variance(self, x_start, t): |
| 280 | """ |
| 281 | Get the distribution q(x_t | x_0). |
| 282 | :param x_start: the [N x C x ...] tensor of noiseless inputs. |
| 283 | :param t: the number of diffusion steps (minus 1). Here, 0 means one step. |
| 284 | :return: A tuple (mean, variance, log_variance), all of x_start's shape. |
| 285 | """ |
| 286 | mean = (extract_into_tensor(self.sqrt_alphas_cumprod, t, x_start.shape) * x_start) |
| 287 | variance = extract_into_tensor(1.0 - self.alphas_cumprod, t, x_start.shape) |
| 288 | log_variance = extract_into_tensor(self.log_one_minus_alphas_cumprod, t, x_start.shape) |
| 289 | return mean, variance, log_variance |
| 290 | |
| 291 | def predict_start_from_noise(self, x_t, t, noise): |
| 292 | return ( |
no test coverage detected