code: def binary_accuracy(predictions, targets, threshold=0.5):
      """Computes the binary accuracy between predictions and targets.
  
      .. math:: L_i = \\mathbb{I}(t_i = \mathbb{I}(p_i \\ge \\alpha))
  
      Parameters
      ----------
      predictions : Theano tensor
          Predictions in [0, 1], such as a sigmoidal output of a neural network,
          giving the probability of the positive class
      targets : Theano tensor
          Targets in {0, 1}, such as ground truth labels.
      threshold : scalar, default: 0.5
          Specifies at what threshold to consider the predictions being of the
          positive class
  
      Returns
      -------
      Theano tensor
          An expression for the element-wise binary accuracy in {0, 1}
  
      Notes
      -----
      This objective function should not be used with a gradient calculation;
      its gradient is zero everywhere. It is intended as a convenience for
      validation and testing, not training.
  
      To obtain the average accuracy, call :func:`theano.tensor.mean()` on the
      result, passing ``dtype=theano.config.floatX`` to compute the mean on GPU.
      """
      predictions, targets = align_targets(predictions, targets)
      predictions = theano.tensor.ge(predictions, threshold)
      return theano.tensor.eq(predictions, targets)
  
file_path: Lasagne/lasagne/objectives.py
imports: import theano.tensor
  from .utils import as_theano_expression
label_desc: Use image node_id 9 for calling a global function with example usage: binary_accuracy(predictions, targets, threshold) and returns: theano