def _get_triple_score(self, head: BoxTensor, tail: BoxTensor,
                          relation: BoxTensor) -> torch.Tensor:
        """ Gets score using conditionals.

        :: note: We do not need to worry about the dimentions of the boxes. If
                it can sensibly broadcast it will.
            """
        if self.is_eval():
            if len(head.data.shape) > len(tail.data.shape):
                tail.data = torch.cat(head.data.shape[-3] * [tail.data])
            elif len(head.data.shape) < len(tail.data.shape):
                head.data = torch.cat(tail.data.shape[-3] * [head.data])

        head_tail_box_vol = head.intersection_log_soft_volume(
            tail,
            temp=self.softbox_temp,
            gumbel_beta=self.gumbel_beta,
            bayesian=True)
        # score = tail_head_relation_box_vol - tail_relation_box.log_soft_volume(
        #    temp=self.softbox_temp)
        score = head_tail_box_vol - tail.log_soft_volume(
            temp=self.softbox_temp)
        if len(np.where(score > 0)[0]):
            breakpoint()
        return score
 def _get_triple_score(self, head: BoxTensor, tail: BoxTensor,
                       relation_head: torch.Tensor,
                       relation_tail: torch.Tensor) -> torch.Tensor:
     head = self.get_relation_transform(box=head, relation=relation_head)
     tail = self.get_relation_transform(tail, relation_tail)
     head_tail_box_vol = head.intersection_log_soft_volume(
         tail, temp=self.softbox_temp)
     score = head_tail_box_vol - tail.log_soft_volume(
         temp=self.softbox_temp)
     return score
    def _get_triple_score(self, head: BoxTensor, tail: BoxTensor,
                          relation: BoxTensor) -> torch.Tensor:
        """ Gets score using conditionals.

        :: note: We do not need to worry about the dimentions of the boxes. If
                it can sensibly broadcast it will.
            """
        #head_relation_box = relation.intersection(head)
        #tail_relation_box = relation.intersection(tail)
        # tail_head_relation_box_vol = tail.intersection_log_soft_volume(
        #    head_relation_box, temp=self.softbox_temp)
        # score = tail_head_relation_box_vol - head_relation_box.log_soft_volume(
        #    temp=self.softbox_temp)
        head_tail_box_vol = head.intersection_log_soft_volume(
            tail, temp=self.softbox_temp)
        # score = tail_head_relation_box_vol - tail_relation_box.log_soft_volume(
        #    temp=self.softbox_temp)
        score = head_tail_box_vol - tail.log_soft_volume(
            temp=self.softbox_temp)

        return score