model.py 文件源码

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

项目:DeepSEA 作者: momeara 项目源码 文件源码
def build_continuous_jaccard_distance_network(fps1, fps2):
    """
    Given two batches of fingerprints, compute the distance between
    the i'th fingerprint from each batch, using the continuous
    generalization of the Jaccard distance:

        1 - \Sum(min(x_i, y_i)) / \Sum(max(x_i, y_i))

    see (Duvenaud, NIPS 2015)

    """
    intersect = tf.reduce_sum(tf.minimum(fps1, fps2), [1], name="intersect")
    union = tf.reduce_sum(tf.maximum(fps1, fps2), [1], name="union")
    tanimoto = tf.div(intersect, union, name="tanimoto")
    jaccard = tf.sub(1.0, tanimoto, name="jaccard")
    return jaccard
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号