随便记录一下。。。
with tf.name_scope("pearson"):
mid1 = tf.reduce_mean(self.score * self.input_y) - \
tf.reduce_mean(self.score) * tf.reduce_mean(self.input_y)
mid2 = tf.sqrt(tf.reduce_mean(tf.square(self.score)) - tf.square(tf.reduce_mean(self.score))) * \
tf.sqrt(tf.reduce_mean(tf.square(self.input_y)) - tf.square(tf.reduce_mean(self.input_y)))
self.pearson = mid1 / mid2