code: def bin_acc(y_pred, y_true, *, threshold=0.0, reduction="mean"):
      """
      Computes the binary accuracy.
  
      This is a functional version of :class:`~poutyne.BinaryAccuracy`.
  
      See :class:`~poutyne.BinaryAccuracy` for details.
      """
      y_pred = (y_pred > threshold).float()
      acc_pred = (y_pred == y_true).float()
      if reduction == "mean":
          acc_pred = acc_pred.mean()
      elif reduction == "sum":
          acc_pred = acc_pred.sum()
      return acc_pred * 100
  
imports: from abc import ABC
  import torch.nn
  from poutyne.framework.metrics.metrics_registering import do_register_metric_func, register_metric_func
label_desc: Use image node_id 2 for calling a global function with example usage: bin_acc(y_pred, y_true) and returns: unknown