code: def _logcosh(x, fun_args=None):
      alpha = fun_args.get("alpha", 1.0)  # comment it out?
  
      x *= alpha
      gx = np.tanh(x, x)  # apply the tanh inplace
      g_x = np.empty(x.shape[0])
      # XXX compute in chunks to avoid extra allocation
      for i, gx_i in enumerate(gx):  # please don't vectorize.
          g_x[i] = (alpha * (1 - gx_i**2)).mean()
      return gx, g_x
  
imports: import warnings
  import numpy
  from scipy import linalg
  from ..base import BaseEstimator, TransformerMixin
  from ..externals import six
  from ..externals.six import moves
  from ..utils import check_array, as_float_array, check_random_state
  from ..utils.extmath import fast_dot
  from ..utils.validation import check_is_fitted
  from ..utils.validation import FLOAT_DTYPES
label_desc: Use image node_id 5 for calling a global function with example usage: _logcosh(x, fun_args) and returns: gx,  g_x