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()
评论列表
文章目录