gpt4 book ai didi

python - TensorFlow 中的关联(如 numpy.correlate)

转载 作者:太空宇宙 更新时间:2023-11-03 21:09:40 24 4
gpt4 key购买 nike

TensorFlow 中是否有 CORRELATE 函数(如 numpy.correlate )?例如,

numpy.correlate(x,y)

最佳答案

我建议this文档。但我不使用这个框架。

我使用pip install --upgrade tensorflow-probability安装了它。

import tensorflow as tf
import tensorflow_probability as tfp


x = tf.random_uniform((5,2),2,3)
y = tf.random_uniform((5,2),2,3)


corr = tfp.stats.correlation(x, y)

with tf.Session() as sess :
print(sess.run( corr))

[[ 0.32789752 -0.12169117]

[ 0.83670807 -0.09973542]]

关于python - TensorFlow 中的关联(如 numpy.correlate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55154405/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com