| 162 | |
| 163 | |
| 164 | class GVPSchedule(LinearSchedule): |
| 165 | def alpha_t(self, t): |
| 166 | return torch.sin(t * math.pi / 2) |
| 167 | |
| 168 | def alpha_dt_t(self, t): |
| 169 | return 0.5 * math.pi * torch.cos(t * math.pi / 2) |
| 170 | |
| 171 | def sigma_t(self, t): |
| 172 | return torch.cos(t * math.pi / 2) |
| 173 | |
| 174 | def sigma_dt_t(self, t): |
| 175 | return - 0.5 * math.pi * torch.sin(t * math.pi / 2) |
| 176 | |
| 177 | def compute_d_alpha_alpha_ratio_t(self, t): |
| 178 | """Special purposed function for computing numerical stabled d_alpha_t / alpha_t""" |
| 179 | return np.pi / (2 * torch.tan(t * np.pi / 2)) |
| 180 | |
| 181 | |
| 182 | """ SDE Sampler """ |