MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / norm_cdf

Function norm_cdf

utils.py:495–497  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

493 # Cut & paste from PyTorch official master until it's in a few official releases - RW
494 # Method based on https://people.sc.fsu.edu/~jburkardt/presentations/truncated_normal.pdf
495 def norm_cdf(x):
496 # Computes standard normal cumulative distribution function
497 return (1. + math.erf(x / math.sqrt(2.))) / 2.
498
499 if (mean < a - 2 * std) or (mean > b + 2 * std):
500 warnings.warn("mean is more than 2 std from [a, b] in nn.init.trunc_normal_. "

Callers 1

_no_grad_trunc_normal_Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected