lstm.py 文件源码

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

项目:ROCStory_skipthought_baseline 作者: soskek 项目源码 文件源码
def calculate_score(self, h, pos, neg, pos_score=None, neg_score=None, multipos=False):
        #h_pro = self.act1(self.W_predict(h))
        h_pro = h
        if multipos:
            # If multiple positive vectors are given,
            # max score is picked up. (other ones are not propagated)
            pos_scoreL = [F.batch_matmul(h_pro, pos_one, transa=True) for pos_one in pos]
            pos_score = F.max(F.concat(pos_scoreL, axis=1), axis=1, keepdims=True)
        else:
            pos_score = F.batch_matmul(h_pro, pos, transa=True)
        neg_score = F.batch_matmul(h_pro, neg, transa=True)

        return pos_score, neg_score
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号