code: def categorical_crossentropy(predictions, targets):
      """Computes the categorical cross-entropy between predictions and targets.
  
      .. math:: L_i = - \\sum_j{t_{i,j} \\log(p_{i,j})}
  
      :math:`p` are the predictions, :math:`t` are the targets, :math:`i`
      denotes the data point and :math:`j` denotes the class.
  
      Parameters
      ----------
      predictions : Theano 2D tensor
          Predictions in (0, 1), such as softmax output of a neural network,
          with data points in rows and class probabilities in columns.
      targets : Theano 2D tensor or 1D tensor
          Either targets in [0, 1] matching the layout of `predictions`, or
          a vector of int giving the correct class index per data point.
          In the case of an integer vector argument, each element
          represents the position of the '1' in a one-hot encoding.
  
      Returns
      -------
      Theano 1D tensor
          An expression for the item-wise categorical cross-entropy.
  
      Notes
      -----
      This is the loss function of choice for multi-class classification
      problems and softmax output units. For hard targets, i.e., targets
      that assign all of the probability to a single class per data point,
      providing a vector of int for the targets is usually slightly more
      efficient than providing a matrix with a single 1.0 per row.
      """
      return theano.tensor.nnet.categorical_crossentropy(
          predictions, targets
      )
  
file_path: Lasagne/lasagne/objectives.py
imports: import theano.tensor
  from .utils import as_theano_expression
label_desc: Use image node_id 3 for calling a global function with example usage: categorical_crossentropy(predictions, targets) and returns: theano