tripletnet.py 文件源码

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

项目:TripletEmbedding 作者: hrantzsch 项目源码 文件源码
def squared_distance(self, anc, pos, neg):
        """
        Compute anchor-positive distance and anchor-negative distance on
        batches of anchors, positive, and negative samples.
        """
        dist_pos = F.expand_dims(F.batch_l2_norm_squared(anc - pos), 1)
        dist_neg = F.expand_dims(F.batch_l2_norm_squared(anc - neg), 1)

        return dist_pos, dist_neg
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号