#NEWLINE# def get_data( train_or_test ) : #NEWLINE# #INDENT# isTrain = ( train_or_test == 'train' ) #NEWLINE# ds = dataset . Cifar10 ( train_or_test ) #NEWLINE# if isTrain : #NEWLINE# #INDENT# augmentors = [ imgaug . RandomCrop ( ( 30 , 30 ) ) , imgaug . Flip ( horiz = True ) , imgaug . Brightness ( 63 ) , imgaug . Contrast ( ( 0.2 , 1.8 ) ) , imgaug . GaussianDeform ( [ ( 0.2 , 0.2 ) , ( 0.2 , 0.8 ) , ( 0.8 , 0.8 ) , ( 0.8 , 0.2 ) ] , ( 30 , 30 ) , 0.2 , 3 ) , imgaug . MeanVarianceNormalize ( all_channel = True ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# augmentors = [ imgaug . CenterCrop ( ( 30 , 30 ) ) , imgaug . MeanVarianceNormalize ( all_channel = True ) ] #NEWLINE# #UNINDENT# ds = AugmentImageComponent ( ds , augmentors ) #NEWLINE# ds = BatchData ( ds , 128 , remainder = ( not isTrain ) ) #NEWLINE# if isTrain : #NEWLINE# #INDENT# ds = PrefetchData ( ds , 10 , 5 ) #NEWLINE# #UNINDENT# return ds