MCPcopy Create free account
hub / github.com/MotrixLab/FineMoGen / approx_standard_normal_cdf

Function approx_standard_normal_cdf

mogen/models/utils/gaussian_diffusion.py:196–202  ·  view source on GitHub ↗

A fast approximation of the cumulative distribution function of the standard normal.

(x)

Source from the content-addressed store, hash-verified

194
195
196def 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
205def discretized_gaussian_log_likelihood(x, *, means, log_scales):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected