<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from pylearn2 . utils import serial <EOL> from pylearn2 . datasets import preprocessing <EOL> from pylearn2 . utils import string_utils as string <EOL> import numpy as np <EOL> import textwrap <EOL> def main ( ) : <EOL> data_dir = string . preprocess ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' ) <EOL> downsampled_dir = data_dir + '<STR_LIT>' <EOL> data = serial . load ( downsampled_dir + '<STR_LIT>' ) <EOL> supplement = serial . load ( downsampled_dir + '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' ) <EOL> data . set_design_matrix ( np . concatenate ( ( data . X , supplement . X ) , axis = <NUM_LIT:0> ) ) <EOL> del supplement <EOL> print ( "<STR_LIT>" ) <EOL> patch_dir = data_dir + '<STR_LIT>' <EOL> serial . mkdir ( patch_dir ) <EOL> README = open ( patch_dir + '<STR_LIT>' , '<STR_LIT:w>' ) <EOL> README . write ( textwrap . dedent ( """<STR_LIT>""" ) ) <EOL> README . close ( ) <EOL> print ( "<STR_LIT>" ) <EOL> pipeline = preprocessing . Pipeline ( ) <EOL> pipeline . items . append ( preprocessing . ExtractPatches ( patch_shape = ( <NUM_LIT:6> , <NUM_LIT:6> ) , <EOL> num_patches = <NUM_LIT:2> * <NUM_LIT:1000> * <NUM_LIT:1000> ) ) <EOL> pipeline . items . append ( <EOL> preprocessing . GlobalContrastNormalization ( use_std = True , sqrt_bias = <NUM_LIT> ) ) <EOL> pipeline . items . append ( preprocessing . ZCA ( ) ) <EOL> data . apply_preprocessor ( preprocessor = pipeline , can_fit = True ) <EOL> data . use_design_loc ( patch_dir + '<STR_LIT>' ) <EOL> serial . save ( patch_dir + '<STR_LIT>' , data ) <EOL> serial . save ( patch_dir + '<STR_LIT>' , pipeline ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
