A fast approximation of the cumulative distribution function of the standard normal.
(x)
| 524 | |
| 525 | |
| 526 | def approx_standard_normal_cdf(x): |
| 527 | """ |
| 528 | A fast approximation of the cumulative distribution function of the standard normal. |
| 529 | """ |
| 530 | return 0.5 * (1.0 + torch.tanh(np.sqrt(2.0 / np.pi) * (x + 0.044715 * torch.pow(x, 3)))) |
| 531 | |
| 532 | |
| 533 | def discretized_gaussian_log_likelihood(x, *, means, log_scales): |
no outgoing calls
no test coverage detected