我想使用张量张量创建Pearson相关系数指标。他们确实有一个TensorFlow概率软件包但这与当前版本的TensorFlow具有依赖性问题。恐怕这会导致Cuda破裂。 Pearson相关系数在TensorFlow中的任何独立实现都会有所帮助...
因此,我想要这样的东西:
def p_corr(y_true, y_pred):
# calculate the pearson correlation coefficient here
return pearson_correlation_coefficient
y_true和y_pred将是相同维度的数字列表。
I wanted to create a pearson correlation coefficient metrics using tensorflow tensor. They do have a tensorflow probability package https://www.tensorflow.org/probability/api_docs/python/tfp/stats/correlation but this have dependency issues with the current version of tensorflow. I am afraid that this will cause the cuda to break. Any standalone implementation of pearson correlation coefficient metrics in tensorflow will help...
So I want something like this:
def p_corr(y_true, y_pred):
# calculate the pearson correlation coefficient here
return pearson_correlation_coefficient
Here y_true and y_pred will be a list of numbers of same dimension.
发布评论
评论(1)
这很好:
This works fine: