A fast approximation of the cumulative distribution function of the standard normal.
(x)
| 194 | |
| 195 | |
| 196 | def approx_standard_normal_cdf(x): |
| 197 | """ |
| 198 | A fast approximation of the cumulative distribution function of the |
| 199 | standard normal. |
| 200 | """ |
| 201 | return 0.5 * ( |
| 202 | 1.0 + th.tanh(np.sqrt(2.0 / np.pi) * (x + 0.044715 * th.pow(x, 3)))) |
| 203 | |
| 204 | |
| 205 | def discretized_gaussian_log_likelihood(x, *, means, log_scales): |
no outgoing calls
no test coverage detected