metrics.py 文件源码

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

项目:wide-deep-cnn 作者: DaniUPC 项目源码 文件源码
def _compute_specific(self, predicted, targets):
        # Generate random predictions with equal probabilities
        random = tf.multinomial(logits=tf.log([[10.] * self._num_classes]),
                                num_samples=tf.shape(targets)[0])
        # Output prediction as ratio of matches
        eq = tf.equal(x=random, y=tf.cast(targets, tf.int64))
        return tf.reduce_mean(tf.cast(eq, tf.float32))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号