class_docstr: A filterer for negative triples based on the Bloom filter.
  
  Pure PyTorch, a proper module which can be moved to GPU, and support batch-wise computation.
  
  .. seealso ::
      * https://github.com/hiway/python-bloom-filter/ - for calculation of sizes, and rough structure of code
      * https://github.com/skeeto/hash-prospector#two-round-functions - for parts of the hash function
docstr: Determine the required number of bits.
  
  :param num:
      The number of elements the Bloom filter shall store.
  :param error_rate:
      The desired error rate.
  
  :return:
      The required number of bits.
docstr_tok: ["Determine","the","required","number","of","bits",".",":","param","num",":","The","number","of","elements","the","Bloom","filter","shall","store",".",":","param","error_rate",":","The","desired","error","rate",".",":","return",":","The","required","number","of","bits","."]
code: def num_bits(num: int, error_rate: float = 0.01) -> int:
      """
      Determine the required number of bits.
  
      :param num:
          The number of elements the Bloom filter shall store.
      :param error_rate:
          The desired error rate.
  
      :return:
          The required number of bits.
      """
      numerator = -1 * num * math.log(error_rate)
      denominator = math.log(2) ** 2
      real_num_bits_m = numerator / denominator
      return int(math.ceil(real_num_bits_m))
  
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 3 for calling the BloomFilterer obj's underlying member method code with example usage: obj.num_bits(num, error_rate) and returns: int