class_docstr: Gradient of the matrix exponential of a square array.
class_docstr_tok: ["Gradient","of","the","matrix","exponential","of","a","square","array","."]
code: def perform(self, node, inputs, outputs):
      # Kalbfleisch and Lawless, J. Am. Stat. Assoc. 80 (1985) Equation 3.4
      # Kind of... You need to do some algebra from there to arrive at
      # this expression.
      (A, gA) = inputs
      (out,) = outputs
      w, V = scipy.linalg.eig(A, right=True)
      U = scipy.linalg.inv(V).T
  
      exp_w = np.exp(w)
      X = np.subtract.outer(exp_w, exp_w) / np.subtract.outer(w, w)
      np.fill_diagonal(X, exp_w)
      Y = U.dot(V.T.dot(gA).dot(U) * X).dot(V.T)
  
      with warnings.catch_warnings():
          warnings.simplefilter("ignore", np.ComplexWarning)
          out[0] = Y.astype(A.dtype)
  
imports: from __future__ import absolute_import, print_function, division
  import logging
  import warnings
  from six.moves import xrange
  import numpy
  from theano import tensor
  import theano.tensor
  from theano.tensor import as_tensor_variable
  from theano.gof import Op, Apply
label_desc: Use image node_id 3 for calling the ExpmGrad obj's underlying member method code with example usage: obj.perform(node, inputs, outputs) without return types