comparison data_generation/pipeline/visualize_filtered.py @ 633:13baba8a4522

merge
author Yoshua Bengio <bengioy@iro.umontreal.ca>
date Sat, 19 Mar 2011 22:51:40 -0400
parents 75dbbe409578
children
comparison
equal deleted inserted replaced
632:5541056d3fb0 633:13baba8a4522
1 import numpy
2 import pylab
3 from pylearn.io import filetensor as ft
4 from ift6266 import datasets
5 from ift6266.datasets.ftfile import FTDataSet
6
7 import time
8 import matplotlib.cm as cm
9
10
11 dataset_str = 'P07safe_' #'PNIST07_' # NISTP
12
13 base_path = '/data/lisatmp/ift6266h10/data/'+dataset_str
14 base_output_path = '/data/lisatmp/ift6266h10/data/transformed_digits/'+dataset_str+'train'
15
16 fileno = 15
17
18 output_data_file = base_output_path+str(fileno)+'_data.ft'
19 output_labels_file = base_output_path+str(fileno)+'_labels.ft'
20
21 dataset_obj = lambda maxsize=None, min_file=0, max_file=100: \
22 FTDataSet(train_data = [output_data_file],
23 train_lbl = [output_labels_file],
24 test_data = [base_path+'_test_data.ft'],
25 test_lbl = [base_path+'_test_labels.ft'],
26 valid_data = [base_path+'_valid_data.ft'],
27 valid_lbl = [base_path+'_valid_labels.ft'])
28 # no conversion or scaling... keep data as is
29 #indtype=theano.config.floatX, inscale=255., maxsize=maxsize)
30
31 dataset = dataset_obj()
32 train_ds = dataset.train(1)
33
34 for i in range(2983):
35 if i < 2900:
36 continue
37 ex = train_ds.next()
38 pylab.ion()
39 pylab.clf()
40 pylab.imshow(ex[0].reshape(32,32),cmap=cm.gray)
41 pylab.draw()
42 time.sleep(0.5)
43