class_docstr: Computes the binary cross entropy loss over a bag-of-words of target tokens.
class_docstr_tok: ["Computes","the","binary","cross","entropy","loss","over","a","bag-of-words","of","target","tokens","."]
code: def __init__(
      self,
      name: str = C.BINARY_CROSS_ENTROPY,
      pos_weight: float = 1.0,
      weight: float = 1.0,
      dtype: str = C.DTYPE_FP32,
      output_name: str = C.NVS_PRED_NAME,
      label_name: str = C.TARGET_LABEL_NAME,
      num_labels: int = 0,
      metric_prefix: str = "",
  ) -> None:
      super().__init__(
          name=name,
          output_name=output_name,
          label_name=label_name,
          weight=weight,
          metric_prefix=metric_prefix,
      )
      self._dtype = dtype
      assert num_labels != 0, "num_labels required"
      self._num_labels = num_labels
      self.ce_loss = DynamicBCEWithLogitsLoss(reduction="none")
      self.pos_weight = pos_weight
  
imports: import logging
  import math
  from abc import ABC, abstractmethod
  from typing import Any, Dict, Optional, Tuple
  import torch
  import numpy
  from .None import constants
  from .None import utils
label_desc: Use image node_id 1 to create a new BinaryCrossEntropyBowLoss object from inherited base classes: Loss with example: obj = BinaryCrossEntropyBowLoss(name, pos_weight, weight, dtype, output_name, label_name, num_labels, metric_prefix)