parameters: (X, tol, g, fun_args, max_iter, w_init)
return_statement: return W, max(n_iter)
docstring: Deflationary FastICA using fun approx to neg-entropy function
  
      Used internally by FastICA.
docstring_summary: Deflationary FastICA using fun approx to neg-entropy function
docstring_tokens: Deflationary FastICA using fun approx to neg - entropy function
function: def _ica_def(X, tol, g, fun_args, max_iter, w_init):
      """Deflationary FastICA using fun approx to neg-entropy function
  
      Used internally by FastICA.
      """
  
      n_components = w_init.shape[0]
      W = np.zeros((n_components, n_components), dtype=X.dtype)
      n_iter = []
  
      # j is the index of the extracted component
      for j in range(n_components):
          w = w_init[j, :].copy()
          w /= np.sqrt((w ** 2).sum())
  
          for i in moves.xrange(max_iter):
              gwtx, g_wtx = g(fast_dot(w.T, X), fun_args)
  
              w1 = (X * gwtx).mean(axis=1) - g_wtx.mean() * w
  
              _gs_decorrelation(w1, W, j)
  
              w1 /= np.sqrt((w1 ** 2).sum())
  
              lim = np.abs(np.abs((w1 * w).sum()) - 1)
              w = w1
              if lim < tol:
                  break
  
          n_iter.append(i + 1)
          W[j, :] = w
  
      return W, max(n_iter)
function_tokens: def _ica_def ( X , tol , g , fun_args , max_iter , w_init ) : n_components = w_init . shape [ 0 ] W = np . zeros ( ( n_components , n_components ) , dtype = X . dtype ) n_iter = [ ] # j is the index of the extracted component for j in range ( n_components ) : w = w_init [ j , : ] . copy ( ) w /= np . sqrt ( ( w ** 2 ) . sum ( ) ) for i in moves . xrange ( max_iter ) : gwtx , g_wtx = g ( fast_dot ( w . T , X ) , fun_args ) w1 = ( X * gwtx ) . mean ( axis = 1 ) - g_wtx . mean ( ) * w _gs_decorrelation ( w1 , W , j ) w1 /= np . sqrt ( ( w1 ** 2 ) . sum ( ) ) lim = np . abs ( np . abs ( ( w1 * w ) . sum ( ) ) - 1 ) w = w1 if lim < tol : break n_iter . append ( i + 1 ) W [ j , : ] = w return W , max ( n_iter )