codes/baseline_models.py [214:236]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        pred_falses = self.forward(inp_false, inp_len_false, y_falses, y_false_lens)
        target_one = torch.ones_like(pred_true)
        target_zero = torch.zeros_like(pred_falses)
        target = torch.cat([target_one, target_zero], dim=0)
        return pred_true, pred_falses, target

    def calc_nce_scores_with_context_batched(self, batch):
        (
            inp,
            inp_len,
            y_true,
            y_true_len,
            y_falses,
            y_false_lens,
            inp_hat,
            inp_hat_len,
        ) = batch
        num_neg_samples = y_falses.size(1)
        y_falses = y_falses.view(-1, y_falses.size(-1))
        y_false_lens = y_false_lens.view(-1, y_false_lens.size(-1))
        inp_false = torch.cat([inp for k in range(num_neg_samples)], dim=0)
        inp_len_false = torch.cat([inp_len for k in range(num_neg_samples)], dim=0)
        pred_true = self.forward(inp, inp_len, y_true, y_true_len)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



codes/baseline_models.py [340:362]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        pred_falses = self.forward(inp_false, inp_len_false, y_falses, y_false_lens)
        target_one = torch.ones_like(pred_true)
        target_zero = torch.zeros_like(pred_falses)
        target = torch.cat([target_one, target_zero], dim=0)
        return pred_true, pred_falses, target

    def calc_nce_scores_with_context_batched(self, batch):
        (
            inp,
            inp_len,
            y_true,
            y_true_len,
            y_falses,
            y_false_lens,
            inp_hat,
            inp_hat_len,
        ) = batch
        num_neg_samples = y_falses.size(1)
        y_falses = y_falses.view(-1, y_falses.size(-1))
        y_false_lens = y_false_lens.view(-1, y_false_lens.size(-1))
        inp_false = torch.cat([inp for k in range(num_neg_samples)], dim=0)
        inp_len_false = torch.cat([inp_len for k in range(num_neg_samples)], dim=0)
        pred_true = self.forward(inp, inp_len, y_true, y_true_len)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



