code: def pinvh(a, cond=None, rcond=None, lower=True):
      """
      Compute the (Moore-Penrose) pseudo-inverse of a hermetian matrix.
  
      Calculate a generalized inverse of a symmetric matrix using its
      eigenvalue decomposition and including all 'large' eigenvalues.
  
      Parameters
      ----------
      a : array, shape (N, N)
          Real symmetric or complex hermetian matrix to be pseudo-inverted.
      cond, rcond : float or None
          Cutoff for 'small' eigenvalues. Singular values smaller than rcond *
          largest_eigenvalue are considered zero.
          If None or -1, suitable machine precision is used.
      lower : boolean
          Whether the pertinent array data is taken from the lower or upper
          triangle of `a`.
  
      Returns
      -------
      B : array, shape (N, N)
  
      Raises
      ------
      LinAlgError
          If eigenvalue does not converge
  
      Notes
      -----
      Function copied from sklearn.utils.extmath.
  
      """
      a = np.asarray_chkfinite(a)
      s, u = linalg.eigh(a, lower=lower)
  
      if rcond is not None:
          cond = rcond
      if cond in [None, -1]:
          t = u.dtype.char.lower()
          factor = {"f": 1e3, "d": 1e6}
          cond = factor[t] * np.finfo(t).eps
  
      # unlike svd case, eigh can lead to negative eigenvalues
      above_cutoff = abs(s) > cond * np.max(abs(s))
      psigma_diag = np.zeros_like(s)
      psigma_diag[above_cutoff] = 1.0 / s[above_cutoff]
  
      return np.dot(u * psigma_diag, np.conjugate(u).T)
  
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 2 for calling a global function with example usage: pinvh(a, cond, rcond, lower) and returns: np