darch/datasets.py
def per_image_whiten(X):
    """ Subtracts the mean of each image in X and renormalizes them to unit norm.

    """
    num_examples, height, width, depth = X.shape

    X_flat = X.reshape((num_examples, -1))
    X_mean = X_flat.mean(axis=1)
    X_cent = X_flat - X_mean[:, None]
    X_norm = np.sqrt( np.sum( X_cent * X_cent, axis=1) ) 
    X_out = X_cent / X_norm[:, None]
    X_out = X_out.reshape(X.shape) 

    return X_out
 Subtracts the mean of each image in X and renormalizes them to unit norm.

    
Subtracts the mean of each image in X and renormalizes them to unit norm.
Subtracts the mean of each image in X and renormalizes them to unit norm .
def per_image_whiten(X):
    num_examples, height, width, depth = X.shape
    X_flat = X.reshape((num_examples, -1))
    X_mean = X_flat.mean(axis=1)
    X_cent = X_flat - X_mean[:, None]
    X_norm = np.sqrt( np.sum( X_cent * X_cent, axis=1) ) 
    X_out = X_cent / X_norm[:, None]
    X_out = X_out.reshape(X.shape) 
    return X_out
def per_image_whiten ( X ) : num_examples , height , width , depth = X . shape X_flat = X . reshape ( ( num_examples , - 1 ) ) X_mean = X_flat . mean ( axis = 1 ) X_cent = X_flat - X_mean [ : , None ] X_norm = np . sqrt ( np . sum ( X_cent * X_cent , axis = 1 ) ) X_out = X_cent / X_norm [ : , None ] X_out = X_out . reshape ( X . shape ) return X_out
Subtracts the mean of each image in X and renormalizes them to unit norm.
Subtracts the mean of each image in X and renormalizes them to unit norm .
""" Subtracts the mean of each image in X and renormalizes them to unit norm.

    """
X