Module Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore ListLoad Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Import alias FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad Num Num body Expr Str Assert CompareEq AttributeLoad NameLoad attr Num Str Assign NameStore Call NameLoad NameLoad Assert CompareGtE NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Num If NameLoad body Assign NameStore BinOpSub NameLoad SubscriptLoad NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Assign NameStore Num If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Num Num body Assign NameStore Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpAdd NameLoad Call AttributeLoad NameLoad attr keyword Num keyword NameLoad NameLoad orelse Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr BinOpAdd NameLoad Call AttributeLoad BinOpPow NameLoad Num attr keyword Num NameLoad Assign SubscriptStore NameLoad Index CompareLt NameLoad NameLoad Num AugAssignDiv NameStore SubscriptLoad NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr Return NameLoad decorator_list
N/A N/A 
Low-level utilities for preprocessing. Should be functions that apply
to NumPy arrays, not preprocessor classes (though preprocessor classes
should reuse these).
 N/A __author__ David Warde-Farley N/A __copyright__ Copyright 2012, Universite de Montreal N/A __credits__ N/A David Warde-Farley N/A __license__ 3-clause BSD N/A __email__ wardefar@iro N/A __maintainer__ David Warde-Farley N/A numpy global_contrast_normalize N/A N/A X scale subtract_mean use_std sqrt_bias min_divisor N/A 1.0 True False 0.0 1e-08 N/A N/A 
    Global contrast normalizes by (optionally) subtracting the mean
    across features and then normalizes by either the vector norm
    or the standard deviation (across features, for each example).

    Parameters
    ----------
    X : ndarray, 2-dimensional
        Design matrix with examples indexed on the first axis and         features indexed on the second.

    scale : float, optional
        Multiply features by this const.

    subtract_mean : bool, optional
        Remove the mean across features/pixels before normalizing.         Defaults to `True`.

    use_std : bool, optional
        Normalize by the per-example standard deviation across features         instead of the vector norm. Defaults to `False`.

    sqrt_bias : float, optional
        Fudge factor added inside the square root. Defaults to 0.

    min_divisor : float, optional
        If the divisor for an example is less than this value,         do not apply it. Defaults to `1e-8`.

    Returns
    -------
    Xp : ndarray, 2-dimensional
        The contrast-normalized features.

    Notes
    -----
    `sqrt_bias` = 10 and `use_std = True` (and defaults for all other
    parameters) corresponds to the preprocessing used in [1].

    References
    ----------
    .. [1] A. Coates, H. Lee and A. Ng. "An Analysis of Single-Layer
       Networks in Unsupervised Feature Learning". AISTATS 14, 2011.
       http://www.stanford.edu/~acoates/papers/coatesleeng_aistats_2011.pdf
     N/A N/A N/A X ndim 2 X.ndim must be 2 N/A scale N/A float scale N/A N/A scale min_divisor N/A mean N/A N/A X mean axis 1 N/A subtract_mean N/A N/A X N/A X N/A mean N/A N/A N/A N/A numpy newaxis N/A N/A X N/A N/A X copy N/A use_std N/A N/A ddof 1 N/A N/A N/A N/A X shape N/A 1 1 N/A N/A ddof 0 N/A normalizers N/A N/A N/A numpy sqrt N/A sqrt_bias N/A N/A X var axis 1 ddof ddof scale N/A N/A normalizers N/A N/A N/A numpy sqrt N/A sqrt_bias N/A N/A N/A X 2 sum axis 1 scale N/A N/A normalizers N/A N/A normalizers min_divisor 1.0 N/A X N/A normalizers N/A N/A N/A N/A numpy newaxis N/A X N/A