models.py 文件源码

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

项目:sk-torch 作者: mattHawthorn 项目源码 文件源码
def forward(self, in_out_pairs):
        # input is batch_size*2 int Variable
        i = self.input_embeddings(in_out_pairs[:, 0])
        o = self.output_embeddings(in_out_pairs[:, 1])
        # raw activations, NCE_Loss handles the sigmoid (we need to know classes to know the sign to apply)
        return (i * o).sum(1).squeeze()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号