我想使用累积分布函数(cdf)的逆函数,这可以使用scipy www.example.com中的norm.ppf()函数https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.norm.html#scipy.stats.norm在tf/keras模型架构的一层中实现。
sqougxex1#
根据文档,tfp.distribution.Normal确实有一个计算ppf(百分点函数)的方法,它被称为quantile:
tfp.distribution.Normal
quantile
scipy.stats.norm(loc=0, scale=1).ppf(0.95)
输出量:
1.6448536269514722
tensorflow :
tfp.distributions.Normal(loc=0, scale=1).quantile(0.95)
<tf.Tensor: shape=(), dtype=float32, numpy=1.6448536>
1条答案
按热度按时间sqougxex1#
根据文档,
tfp.distribution.Normal
确实有一个计算ppf(百分点函数)的方法,它被称为quantile
:输出量:
tensorflow :
输出量: