Raa*_*ady 4 python statistics probability-density tensorflow
在Matlab中,我可以使用来计算高斯分布的概率密度函数(PDF)
x = [0.8147,0.9058,0.1270,0.9134,0.6324,0.0975,0.2785,0.5469,0.9575,0.9649]
y = normpdf(x,1.0,2.5)
Run Code Online (Sandbox Code Playgroud)
输出:
y = 0.1591 0.1595 0.1501 0.1595 0.1579 0.1495 0.1531 0.1570 0.1596 0.1596
Run Code Online (Sandbox Code Playgroud)
我使用张量流尝试了这个
x = tf.variable([0.8147,0.9058,0.1270,0.9134,0.6324,0.0975,0.2785,0.5469,0.9575,0.9649],tf.float32)
y = tf.contrib.distributions.NormalWithSoftplusSigma.pdf(x)
Run Code Online (Sandbox Code Playgroud)
我得到一个错误 TypeError: pdf missing 1 required positional argument
如何输入mu和sigma值到此分布?得到类似的输出。
小智 5
此功能pdf更新为prob:
dist = tf.contrib.distributions.Normal(1.0, 2.5)
y = dist.prob(x)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2441 次 |
| 最近记录: |