class_docstr: An interface for filtering methods for negative triples.
docstr: Filter all proposed negative samples that are positive in the training dataset.
  
  Normally there is a low probability that proposed negative samples are positive in the training datasets and
  thus act as false negatives. This is expected to act as a kind of regularization, since it adds noise signal to
  the training data. However, the degree of regularization is hard to control since the added noise signal depends
  on the ratio of true triples for a given entity relation or entity entity pair. Therefore, the effects are hard
  to control and a researcher might want to exclude the possibility of having false negatives in the proposed
  negative triples.
  
  .. note ::
      Filtering is a very expensive task, since every proposed negative sample has to be checked against the
      entire training dataset.
  
  :param negative_batch: shape: (batch_size, num_negatives, 3)
      The batch of negative triples.
  
  :return: shape: (batch_size, num_negatives)
      A mask, where True indicates that the negative sample is valid.
docstr_tok: ["Filter","all","proposed","negative","samples","that","are","positive","in","the","training","dataset",".","Normally","there","is","a","low","probability","that","proposed","negative","samples","are","positive","in","the","training","datasets","and","thus","act","as","false","negatives",".","This","is","expected","to","act","as","a","kind","of","regularization",",","since","it","adds","noise","signal","to","the","training","data",".","However",",","the","degree","of","regularization","is","hard","to","control","since","the","added","noise","signal","depends","on","the","ratio","of","true","triples","for","a","given","entity","relation","or","entity","entity","pair",".","Therefore",",","the","effects","are","hard","to","control","and","a","researcher","might","want","to","exclude","the","possibility","of","having","false","negatives","in","the","proposed","negative","triples",".","..","note",":",":","Filtering","is","a","very","expensive","task",",","since","every","proposed","negative","sample","has","to","be","checked","against","the","entire","training","dataset",".",":","param","negative_batch",":","shape",":","(","batch_size",",","num_negatives",",","3",")","The","batch","of","negative","triples",".",":","return",":","shape",":","(","batch_size",",","num_negatives",")","A","mask",",","where","True","indicates","that","the","negative","sample","is","valid","."]
code: def forward(
      self,
      negative_batch: MappedTriples,
  ) -> torch.BoolTensor:
      """Filter all proposed negative samples that are positive in the training dataset.
  
      Normally there is a low probability that proposed negative samples are positive in the training datasets and
      thus act as false negatives. This is expected to act as a kind of regularization, since it adds noise signal to
      the training data. However, the degree of regularization is hard to control since the added noise signal depends
      on the ratio of true triples for a given entity relation or entity entity pair. Therefore, the effects are hard
      to control and a researcher might want to exclude the possibility of having false negatives in the proposed
      negative triples.
  
      .. note ::
          Filtering is a very expensive task, since every proposed negative sample has to be checked against the
          entire training dataset.
  
      :param negative_batch: shape: (batch_size, num_negatives, 3)
          The batch of negative triples.
  
      :return: shape: (batch_size, num_negatives)
          A mask, where True indicates that the negative sample is valid.
      """
      return ~self.contains(batch=negative_batch)
  
imports: import math
  from abc import abstractmethod
  from typing import Iterable
  import torch
  from class_resolver import ClassResolver
  from torch import nn
  from ..typing import MappedTriples
  from ..utils import triple_tensor_to_set
label_desc: Use image node_id 1 for calling the Filterer obj's underlying member method code with example usage: obj.forward(negative_batch) and returns: unknown