class_docstr: The layer that calculates the focal loss function for binary
  classification. It is a version of cross-entropy in which 
  the easily-distinguished objects receive smaller penalties. This helps
  focus on learning the difference between similar-looking elements of
  different classes.
  
  :math:`f(x) = -(sigmoid(-y * x))^{force} * \log(1 + e^{-y * x})`
  where:
  x is the network response, 
  y is the correct class label (1 or -1).
  
  :param input_layers: The input layers to be connected. 
      The integer in each tuple specifies the number of the output.
      If not set, the first output will be used.
  :type input_layers: list of object, tuple(object, int)
  :param force: The focal force, that is, the degree to which learning
      will concentrate on similar objects.
  :type force: float, > 0, default=2.0
  :param loss_weight: The multiplier for the loss function value during training.
  :type loss_weight: float, default=1.0
  :param name: The layer name.
  :type name: str, default=None
  
  .. rubric:: Layer inputs:
  
  (1) the network response for which you are calculating the loss.
      It should contain the probability distribution for objects over classes.
  
  (2) the correct class labels (1 or -1). 
  
  (3) (optional): the objects' weights.
  
  The dimensions of all inputs are the same:
  
      - **BatchLength** * **BatchWidth** * **ListSize** - the number of objects
      - **Height**, **Width**, **Depth**, **Channels** should be equal to 1
  
  .. rubric:: Layer outputs:
  
  The layer has no output.
class_docstr_tok: ["The","layer","that","calculates","the","focal","loss","function","for","binary","classification",".","It","is","a","version","of","cross-entropy","in","which","the","easily-distinguished","objects","receive","smaller","penalties",".","This","helps","focus","on","learning","the","difference","between","similar-looking","elements","of","different","classes",".",":","math",":","`","f","(","x",")","=","-","(","sigmoid","(","-y","*","x",")",")","^","{","force","}","*","\\log","(","1","+","e^","{","-y","*","x","}",")","`","where",":","x","is","the","network","response",",","y","is","the","correct","class","label","(","1","or","-1",")",".",":","param","input_layers",":","The","input","layers","to","be","connected",".","The","integer","in","each","tuple","specifies","the","number","of","the","output",".","If","not","set",",","the","first","output","will","be","used",".",":","type","input_layers",":","list","of","object",",","tuple","(","object",",","int",")",":","param","force",":","The","focal","force",",","that","is",",","the","degree","to","which","learning","will","concentrate","on","similar","objects",".",":","type","force",":","float",",",">","0",",","default=2.0",":","param","loss_weight",":","The","multiplier","for","the","loss","function","value","during","training",".",":","type","loss_weight",":","float",",","default=1.0",":","param","name",":","The","layer","name",".",":","type","name",":","str",",","default=None","..","rubric",":",":","Layer","inputs",":","(","1",")","the","network","response","for","which","you","are","calculating","the","loss",".","It","should","contain","the","probability","distribution","for","objects","over","classes",".","(","2",")","the","correct","class","labels","(","1","or","-1",")",".","(","3",")","(","optional",")",":","the","objects","'","weights",".","The","dimensions","of","all","inputs","are","the","same",":","-","*","*","BatchLength","*","*","*","*","*","BatchWidth","*","*","*","*","*","ListSize","*","*","-","the","number","of","objects","-","*","*","Height","*","*",",","*","*","Width","*","*",",","*","*","Depth","*","*",",","*","*","Channels","*","*","should","be","equal","to","1","..","rubric",":",":","Layer","outputs",":","The","layer","has","no","output","."]
code: def __init__(self, input_layers, force, loss_weight=1.0, name=None):
      if type(input_layers) is PythonWrapper.BinaryFocalLoss:
          super().__init__(input_layers)
          return
  
      if force <= 0:
          raise ValueError("The `force` must be > 0.")
  
      layers, outputs = check_input_layers(input_layers, (2, 3))
  
      internal = PythonWrapper.BinaryFocalLoss(
          str(name), layers, outputs, float(force), float(loss_weight)
      )
      super().__init__(internal)
  
imports: import neoml.PythonWrapper
  from .Dnn import Layer
  from neoml.Utils import check_input_layers
  from abc import ABCMeta, abstractmethod
  import neoml.Blob
label_desc: Use image node_id 1 to create a new BinaryFocalLoss object from inherited base classes: Loss with example: obj = BinaryFocalLoss(input_layers, force, loss_weight, name)