code: def binary_hinge(expected, predicted, delta=1):
      """
      Computes the binary hinge loss between predictions
      and targets.
  
      .. math::
          hinge(t, o) = \\max(0, \\delta - t o)
  
      where :math:`t=expected` and :math:`o=predicted`
  
      Parameters
      ----------
      expected : Tensorfow tensor
          Targets in {-1, 1} such as ground truth labels.
  
      predicted : Tensorfow tensor
          Predictions in (-1, 1), such as hyperbolic tangent
          output of a neural network.
  
      delta : scalar
          The hinge loss margin. Defaults to ``1``.
  
      Returns
      -------
      Tensorfow tensor
          An expression for the average binary hinge loss.
  
      Notes
      -----
      This is an alternative to the binary cross-entropy
      loss for binary classification problems.
      """
      error = tf.nn.relu(delta - predicted * expected)
      return tf.reduce_mean(error)
  
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 9 for calling a global function with example usage: binary_hinge(expected, predicted, delta) and returns: tf