# HG changeset patch # User Xavier Glorot # Date 1268755940 14400 # Node ID 39421555993f4efead0cbda81111cc6abd6cca60 # Parent 3632e6258642499640868362bfe9bd294429b5c2 small change in gimp_script to avoid blurring in PNIST diff -r 3632e6258642 -r 39421555993f data_generation/transformations/gimp_script.py --- a/data_generation/transformations/gimp_script.py Tue Mar 02 14:47:18 2010 -0500 +++ b/data_generation/transformations/gimp_script.py Tue Mar 16 12:12:20 2010 -0400 @@ -30,12 +30,16 @@ return numpy.fromstring(dest_rgn[:,:], 'UInt8').astype(numpy.float32).reshape((32,32)).T / 255.0 class GIMP1(): - def get_settings_names(self): + def __init__(self, blur_bool = True): + #This is used to avoid blurring for PNIST + self.blur_bool = blur_bool + + def get_settings_names(self, blur_bool = True): return ['mblur_length', 'mblur_angle', 'pinch'] def regenerate_parameters(self, complexity): - if complexity: - self.mblur_length = abs(int(round(numpy.random.normal(0, 3*complexity)))) + if complexity and self.blur_bool: + self.mblur_length = abs(int(round(numpy.random.normal(0, 3*complexity)))) else: self.mblur_length = 0 self.mblur_angle = int(round(numpy.random.uniform(0,360)))