code: def binary_crossentropy(expected, predicted):
      """
      Binary cross-entropy error.
  
      .. math::
          crossentropy(t, o) = -(t\\cdot log(o) + (1 - t) \\cdot log(1 - o))
  
      where :math:`t=expected` and :math:`o=predicted`
  
      Parameters
      ----------
      {error_function.expected}
      {error_function.predicted}
  
      Returns
      -------
      {error_function.Returns}
      """
      epsilon = smallest_positive_number
  
      predicted = tf.clip_by_value(predicted, epsilon, 1.0 - epsilon)
      crossentropy = -expected * tf.log(predicted) - (
          1 - expected
      ) * tf.log(1 - predicted)
  
      return tf.reduce_mean(crossentropy)
  
file_path: neupy/neupy/algorithms/gd/objectives.py
imports: from __future__ import division
  import tensorflow
  from neupy.core.docs import shared_docs
  from neupy.utils import asfloat, function_name_scope
label_desc: Use image node_id 7 for calling a global function with example usage: binary_crossentropy(expected, predicted) and returns: tf