comparison transformations/thick.py @ 19:db10ee2a07fb

merged 2 thick parameter in one
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Thu, 28 Jan 2010 14:48:12 -0500
parents c91d9f70206d
children 442789c94b27
comparison
equal deleted inserted replaced
17:c91d9f70206d 19:db10ee2a07fb
36 #---------- generation parameters 36 #---------- generation parameters
37 self.regenerate_parameters(complexity) 37 self.regenerate_parameters(complexity)
38 #------------------------------------------------ 38 #------------------------------------------------
39 39
40 def _get_current_parameters(self): 40 def _get_current_parameters(self):
41 return [self.meth,self.nb] 41 return [self.thick_param]
42 42
43 def get_settings_names(self): 43 def get_settings_names(self):
44 return ['meth','nb'] 44 return ['thick_param']
45 45
46 def regenerate_parameters(self, complexity): 46 def regenerate_parameters(self, complexity):
47 self.erodenb = N.ceil(complexity * self.__erodemax__) 47 self.erodenb = N.ceil(complexity * self.__erodemax__)
48 self.dilatenb = N.ceil(complexity * self.__dilatemax__) 48 self.dilatenb = N.ceil(complexity * self.__dilatemax__)
49 self.Perode = self.erodenb / (self.dilatenb + self.erodenb + 1.0) 49 self.Perode = self.erodenb / (self.dilatenb + self.erodenb + 1.0)
59 self.meth = -1 59 self.meth = -1
60 self.nb=N.random.randint(self.erodenb) 60 self.nb=N.random.randint(self.erodenb)
61 else: 61 else:
62 self.meth = 0 62 self.meth = 0
63 self.nb = -1 63 self.nb = -1
64 self.thick_param = self.meth*self.nb
64 return self._get_current_parameters() 65 return self._get_current_parameters()
65 66
66 def transform_1_image(self,image): #the real transformation method 67 def transform_1_image(self,image): #the real transformation method
67 if self.meth!=0: 68 if self.meth!=0:
68 maxi = float(N.max(image)) 69 maxi = float(N.max(image))