code: def binary_crossentropy(y_pred, y_true):
      """Binary Crossentropy.
  
      Computes sigmoid cross entropy between y_pred (logits) and y_true
      (labels).
  
      Measures the probability error in discrete classification tasks in which
      each class is independent and not mutually exclusive. For instance,
      one could perform multilabel classification where a picture can contain
      both an elephant and a dog at the same time.
  
      For brevity, let `x = logits`, `z = targets`.  The logistic loss is
  
        x - x * z + log(1 + exp(-x))
  
      To ensure stability and avoid overflow, the implementation uses
  
        max(x, 0) - x * z + log(1 + exp(-abs(x)))
  
      `y_pred` and `y_true` must have the same type and shape.
  
      Arguments:
          y_pred: `Tensor` of `float` type. Predicted values.
          y_true: `Tensor` of `float` type. Targets (labels).
  
      """
      with tf.name_scope("BinaryCrossentropy"):
          return tf.reduce_mean(
              tf.nn.sigmoid_cross_entropy_with_logits(
                  logits=y_pred, labels=y_true
              )
          )
  
file_path: tflearn/tflearn/objectives.py
imports: from __future__ import division, print_function, absolute_import
  import tensorflow.compat.v1
  from .config import _EPSILON, _FLOATX
  from .utils import get_from_module
label_desc: Use image node_id 4 for calling a global function with example usage: binary_crossentropy(y_pred, y_true) and returns: tf