(X, tol, g, gprime, fun_args, maxit, w_init)
return W
Parallel FastICA.

    Used internally by FastICA.
Parallel FastICA.
Parallel FastICA .
def _ica_par(X, tol, g, gprime, fun_args, maxit, w_init):
    """Parallel FastICA.

    Used internally by FastICA.

    """
    n,p = X.shape
    
    W = _sym_decorrelation(w_init)

    # we set lim to tol+1 to be sure to enter at least once in next while
    lim = tol + 1 
    it = 0
    while ((lim > tol) and (it < (maxit-1))):
        wtx = np.dot(W, X).A  # .A transforms to array type
        gwtx = g(wtx, fun_args)
        g_wtx = gprime(wtx, fun_args)
        W1 = np.dot(gwtx, X.T)/float(p) - np.dot(np.diag(g_wtx.mean(axis=1)), W)
 
        W1 = _sym_decorrelation(W1)
        
        lim = max(abs(abs(np.diag(np.dot(W1, W.T))) - 1))
        W = W1
        it = it + 1

    return W
def _ica_par ( X , tol , g , gprime , fun_args , maxit , w_init ) : n , p = X . shape W = _sym_decorrelation ( w_init ) # we set lim to tol+1 to be sure to enter at least once in next while lim = tol + 1 it = 0 while ( ( lim > tol ) and ( it < ( maxit - 1 ) ) ) : wtx = np . dot ( W , X ) . A # .A transforms to array type gwtx = g ( wtx , fun_args ) g_wtx = gprime ( wtx , fun_args ) W1 = np . dot ( gwtx , X . T ) / float ( p ) - np . dot ( np . diag ( g_wtx . mean ( axis = 1 ) ) , W ) W1 = _sym_decorrelation ( W1 ) lim = max ( abs ( abs ( np . diag ( np . dot ( W1 , W . T ) ) ) - 1 ) ) W = W1 it = it + 1 return W