code: def categorical_crossentropy(expected, predicted):
      """
      Categorical cross-entropy error.
  
      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)
      errors = tf.reduce_sum(expected * tf.log(predicted), axis=-1)
  
      return -tf.reduce_mean(errors)
  
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 8 for calling a global function with example usage: categorical_crossentropy(expected, predicted) and returns: unknown