tf_helpers.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:RoadSegmentation 作者: njroussel 项目源码 文件源码
def init_cov_matrix_tf(predictions, correct_predictions):
    true_pred = tf.boolean_mask(predictions, correct_predictions)
    false_pred = tf.boolean_mask(predictions, tf.logical_not(correct_predictions))

    truePos = tf.reduce_sum(tf.cast(tf.equal(true_pred, 1), tf.float32))

    falsePos = tf.reduce_sum(tf.cast(tf.equal(false_pred, 1), tf.float32))

    trueNeg = tf.reduce_sum(tf.cast(tf.equal(true_pred, 0), tf.float32))

    falseNeg = tf.reduce_sum(tf.cast(tf.equal(false_pred, 0), tf.float32))

    return (truePos, falsePos, trueNeg, falseNeg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号