diff transformations/testtransformations.py @ 129:a507adba0ce3

Changes to fit with visualisation
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Thu, 18 Feb 2010 14:43:53 -0500
parents 5e00ed18ae32
children
line wrap: on
line diff
--- a/transformations/testtransformations.py	Thu Feb 18 12:58:34 2010 -0500
+++ b/transformations/testtransformations.py	Thu Feb 18 14:43:53 2010 -0500
@@ -62,7 +62,7 @@
                 #ctmp = N.random.rand()*complexity[ct]
                 ctmp = N.random.rand()*complexity 
                 #print j.get_settings_names(), j.regenerate_parameters(ctmp)
-                j.regenerate_parameters(ctmp)
+                th=j.regenerate_parameters(ctmp)
                 
                 b=j.transform_image(b)
                 c=N.asarray([b*255]*3).T
@@ -74,6 +74,8 @@
                     screen.blit(new,(offset,offset2))
                     font = pygame.font.SysFont('liberationserif',18)
                     text = font.render('%s '%(int(ctmp*100.0)/100.0) + j.__module__,0,(255,255,255),(0,0,0))
+                    #if  j.__module__ == 'Rature':
+                    #     text = font.render('%s,%s'%(th[-1],int(ctmp*100.0)/100.0) + j.__module__,0,(255,255,255),(0,0,0))
                     screen.blit(text,(offset,offset2+4*32))
                     if ct == len(MODULE_INSTANCES)/2-1:
                         offset = 0
@@ -109,6 +111,28 @@
 
 d = N.zeros((n,1024))
 
+datapath = '/data/lisa/data/ocr_breuel/filetensor/unlv-corrected-2010-02-01-shuffled.ft'
+f = open(datapath)
+d = ft.read(f)
+d = d[0:n,:]/255.0
+createimage('/u/glorotxa/transf/OCR',d)
+
+
+
+datapath = '/data/lisa/data/nist/by_class/'
+f = open(datapath+'digits_reshuffled/digits_reshuffled_train_data.ft')
+d = ft.read(f)
+d = d[0:n,:]/255.0
+createimage('/u/glorotxa/transf/NIST_digits',d)
+
+
+
+datapath = '/data/lisa/data/nist/by_class/'
+f = open(datapath+'upper/upper_train_data.ft')
+d = ft.read(f)
+d = d[0:n,:]/255.0
+createimage('/u/glorotxa/transf/NIST_upper',d)
+
 from Facade import *
 
 for i in range(n):
@@ -122,33 +146,11 @@
     d[i,:]=N.reshape(myttf2jpg.generate_image()[0],(1,1024))
 createimage('/u/glorotxa/transf/fonts',d)
 
-
-datapath = '/data/lisa/data/nist/by_class/'
-f = open(datapath+'digits_reshuffled/digits_reshuffled_train_data.ft')
-d = ft.read(f)
-d = d[0:n,:]/255.0
-createimage('/u/glorotxa/transf/NIST_digits',d)
-
-
 datapath = '/data/lisa/data/nist/by_class/'
 f = open(datapath+'lower/lower_train_data.ft')
 d = ft.read(f)
 d = d[0:n,:]/255.0
 createimage('/u/glorotxa/transf/NIST_lower',d)
 
-datapath = '/data/lisa/data/nist/by_class/'
-f = open(datapath+'upper/upper_train_data.ft')
-d = ft.read(f)
-d = d[0:n,:]/255.0
-createimage('/u/glorotxa/transf/NIST_upper',d)
-datapath = '/data/lisa/data/ocr_breuel/filetensor/unlv-corrected-2010-02-01-shuffled.ft'
-f = open(datapath)
-d = ft.read(f)
-d = d[0:n,:]/255.0
-createimage('/u/glorotxa/transf/OCR',d)
-
-
-
-
 
 #pygame.display.quit()