comparison transformations/affine_transform.py @ 120:5e00ed18ae32

changed some transformation paramters to better fit with visualization
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Wed, 17 Feb 2010 17:45:48 -0500
parents 859ebd7f8754
children b852dddf43a6
comparison
equal deleted inserted replaced
119:4f37755d301b 120:5e00ed18ae32
17 def __init__( self, complexity = .5): 17 def __init__( self, complexity = .5):
18 self.shape = (32,32) 18 self.shape = (32,32)
19 self.rng = numpy.random.RandomState() 19 self.rng = numpy.random.RandomState()
20 self.complexity = complexity 20 self.complexity = complexity
21 params = self.rng.uniform(size=6) -.5 21 params = self.rng.uniform(size=6) -.5
22 self.a = 1. + params[0]*.4*complexity 22 self.a = 1. + params[0]*.8*complexity
23 self.b = 0. + params[1]*.4*complexity 23 self.b = 0. + params[1]*.8*complexity
24 self.c = params[2]*8.*complexity 24 self.c = params[2]*9.*complexity
25 self.d = 0. + params[3]*.4*complexity 25 self.d = 0. + params[3]*.8*complexity
26 self.e = 1. + params[4]*.4*complexity 26 self.e = 1. + params[4]*.8*complexity
27 self.f = params[5]*8.*complexity 27 self.f = params[5]*9.*complexity
28 28
29 29
30 def _get_current_parameters(self): 30 def _get_current_parameters(self):
31 return [self.a, self.b, self.c, self.d, self.e, self.f] 31 return [self.a, self.b, self.c, self.d, self.e, self.f]
32 32
42 42
43 # the ranges are set manually as to look acceptable 43 # the ranges are set manually as to look acceptable
44 44
45 self.complexity = complexity 45 self.complexity = complexity
46 params = self.rng.uniform(size=6) -.5 46 params = self.rng.uniform(size=6) -.5
47 self.a = 1. + params[0]*.4*complexity 47 self.a = 1. + params[0]*.8*complexity
48 self.b = 0. + params[1]*.4*complexity 48 self.b = 0. + params[1]*.8*complexity
49 self.c = params[2]*8.*complexity 49 self.c = params[2]*9.*complexity
50 self.d = 0. + params[3]*.4*complexity 50 self.d = 0. + params[3]*.8*complexity
51 self.e = 1. + params[4]*.4*complexity 51 self.e = 1. + params[4]*.8*complexity
52 self.f = params[5]*8.*complexity 52 self.f = params[5]*9.*complexity
53 return self._get_current_parameters() 53 return self._get_current_parameters()
54 54
55 55
56 56
57 57