code: def huber_loss(predictions, targets, delta=1):
      """Computes the huber loss between predictions and targets.
  
      .. math:: L_i = \\frac{(p - t)^2}{2},  |p - t| \\le \\delta
  
          L_i = \\delta (|p - t| - \\frac{\\delta}{2} ), |p - t| \\gt \\delta
  
      Parameters
      ----------
      predictions : Theano 2D tensor or 1D tensor
          Prediction outputs of a neural network.
  
      targets : Theano 2D tensor or 1D tensor
          Ground truth to which the prediction is to be compared
          with. Either a vector or 2D Tensor.
  
      delta : scalar, default 1
          This delta value is defaulted to 1, for `SmoothL1Loss`
          described in Fast-RCNN paper [1]_ .
  
      Returns
      -------
      Theano tensor
          An expression for the element-wise huber loss [2]_ .
  
      Notes
      -----
      This is an alternative to the squared error for
      regression problems.
  
      References
      ----------
      .. [1] Ross Girshick et al (2015):
             Fast RCNN
             https://arxiv.org/pdf/1504.08083.pdf
  
      .. [2] Huber, Peter et al (1964)
             Robust Estimation of a Location Parameter
             https://projecteuclid.org/euclid.aoms/1177703732
      """
      predictions, targets = align_targets(predictions, targets)
      abs_diff = abs(targets - predictions)
      ift = 0.5 * squared_error(targets, predictions)
      iff = delta * (abs_diff - delta / 2.0)
      return theano.tensor.switch(abs_diff <= delta, ift, iff)
  
file_path: Lasagne/lasagne/objectives.py
imports: import theano.tensor
  from .utils import as_theano_expression
label_desc: Use image node_id 8 for calling a global function with example usage: huber_loss(predictions, targets, delta) and returns: theano