MCPcopy Create free account
hub / github.com/CompVis/diff2flow / approx_standard_normal_cdf

Function approx_standard_normal_cdf

diff2flow/ddpm.py:526–530  ·  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

524
525
526def 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
533def discretized_gaussian_log_likelihood(x, *, means, log_scales):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected