code: def logsumexp(arr, axis=0):
      """
      Computes the sum of arr assuming arr is in the log domain.
  
      Parameters
      ----------
      arr : numpy array
          Input data [log domain].
      axis : int, optional
          Axis to operate on.
  
      Returns
      -------
      numpy array
          log(sum(exp(arr))) while minimizing the possibility of over/underflow.
  
      Notes
      -----
      Function copied from sklearn.utils.extmath.
  
      """
      arr = np.rollaxis(arr, axis)
      # Use the max to normalize, as with the log this is what accumulates
      # the less errors
      vmax = arr.max(axis=0)
      out = np.log(np.sum(np.exp(arr - vmax), axis=0))
      out += vmax
      return out
  
file_path: madmom/madmom/ml/gmm.py
imports: from __future__ import absolute_import, division, print_function
  import numpy
  from scipy import linalg
label_desc: Use image node_id 1 for calling a global function with example usage: logsumexp(arr, axis) and returns: out