siamese.py 文件源码

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

项目:few_shot_mAP_public 作者: eleniTriantafillou 项目源码 文件源码
def join_branches(self, feats_A, feats_B):
    feats_A = tf.truediv(
        feats_A, tf.sqrt(tf.reduce_sum(tf.square(feats_A), 1, keep_dims=True)))
    feats_B = tf.truediv(
        feats_B, tf.sqrt(tf.reduce_sum(tf.square(feats_B), 1, keep_dims=True)))
    if self.config.join_branches == "concat":
      pair_feats = tf.concat(1, [feats_A, feats_B])
    elif self.config.join_branches == "abs_diff":
      pair_feats = tf.abs(feats_A - feats_B)
    return pair_feats
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号