code: def softmax(x, out=None):
      """
      Softmax transfer function.
  
      Parameters
      ----------
      x : numpy array
          Input data.
      out : numpy array, optional
          Array to hold the output data.
  
      Returns
      -------
      numpy array
          Softmax of input data.
  
      """
      # determine maximum (over classes)
      tmp = np.amax(x, axis=1, keepdims=True)
      # exp of the input minus the max
      if out is None:
          out = np.exp(x - tmp)
      else:
          np.exp(x - tmp, out=out)
      # normalize by the sum (reusing the tmp variable)
      np.sum(out, axis=1, keepdims=True, out=tmp)
      out /= tmp
      return out
  
file_path: madmom/madmom/ml/nn/activations.py
imports: from __future__ import absolute_import, division, print_function
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: softmax(x, out) and returns: out