Mercurial > ift6266
comparison transformations/affine_transform.py @ 144:c958941c1b9d
merge
author | XavierMuller |
---|---|
date | Tue, 23 Feb 2010 18:16:55 -0500 |
parents | b852dddf43a6 |
children | ce56e8ca960d |
comparison
equal
deleted
inserted
replaced
143:f341a4efb44a | 144:c958941c1b9d |
---|---|
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]*.6*complexity |
23 self.b = 0. + params[1]*.4*complexity | 23 self.b = 0. + params[1]*.6*complexity |
24 self.c = params[2]*8.*complexity | 24 self.c = params[2]*8.*complexity |
25 self.d = 0. + params[3]*.4*complexity | 25 self.d = 0. + params[3]*.6*complexity |
26 self.e = 1. + params[4]*.4*complexity | 26 self.e = 1. + params[4]*.6*complexity |
27 self.f = params[5]*8.*complexity | 27 self.f = params[5]*8.*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] |
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 |