def normal_inverse_cdf(p: T.Tensor) -> T.Tensor:
"""
Elementwise inverse cumulative distribution function of the standard normal
distribution.
For the inverse CDF of a normal distributon with mean u and standard deviation sigma,
use u + sigma * normal_inverse_cdf(p).
Args:
p (tensor bounded in (0,1))
Returns:
tensor: Elementwise inverse cdf
"""
return SQRT2*erfinv(2*numpy.clip(p, a_min=EPSILON, a_max=1-EPSILON)-1)
评论列表
文章目录