comparison datasets/defs.py @ 231:6f4e3719a3cc

Added the possibility to get the paths from an env. variable + cleaned up the way we build the paths
author Dumitru Erhan <dumitru.erhan@gmail.com>
date Sat, 13 Mar 2010 15:44:50 -0500
parents 4cfd0eb438af
children 966272e7f14b
comparison
equal deleted inserted replaced
228:851e7ad4a143 231:6f4e3719a3cc
2 'nist_P07', 'mnist'] 2 'nist_P07', 'mnist']
3 3
4 from ftfile import FTDataSet 4 from ftfile import FTDataSet
5 from gzpklfile import GzpklDataSet 5 from gzpklfile import GzpklDataSet
6 import theano 6 import theano
7 import os
7 8
8 NIST_PATH = '/data/lisa/data/nist/by_class/' 9 # if the environmental variables exist, get the path from them,
9 DATA_PATH = '/data/lisa/data/ift6266h10/' 10 # otherwise fall back on the default
11 NIST_PATH = os.getenv('NIST_PATH','/data/lisa/data/nist/by_class/')
12 DATA_PATH = os.getenv('DATA_PATH','/data/lisa/data/ift6266h10/')
10 13
11 nist_digits = FTDataSet(train_data = [NIST_PATH+'digits/digits_train_data.ft'], 14 nist_digits = FTDataSet(train_data = [os.path.join(NIST_PATH,'digits/digits_train_data.ft')],
12 train_lbl = [NIST_PATH+'digits/digits_train_labels.ft'], 15 train_lbl = [os.path.join(NIST_PATH,'digits/digits_train_labels.ft')],
13 test_data = [NIST_PATH+'digits/digits_test_data.ft'], 16 test_data = [os.path.join(NIST_PATH,'digits/digits_test_data.ft')],
14 test_lbl = [NIST_PATH+'digits/digits_test_labels.ft'], 17 test_lbl = [os.path.join(NIST_PATH,'digits/digits_test_labels.ft')],
15 indtype=theano.config.floatX, inscale=255.) 18 indtype=theano.config.floatX, inscale=255.)
16 nist_lower = FTDataSet(train_data = [NIST_PATH+'lower/lower_train_data.ft'], 19 nist_lower = FTDataSet(train_data = [os.path.join(NIST_PATH,'lower/lower_train_data.ft')],
17 train_lbl = [NIST_PATH+'lower/lower_train_labels.ft'], 20 train_lbl = [os.path.join(NIST_PATH,'lower/lower_train_labels.ft')],
18 test_data = [NIST_PATH+'lower/lower_test_data.ft'], 21 test_data = [os.path.join(NIST_PATH,'lower/lower_test_data.ft')],
19 test_lbl = [NIST_PATH+'lower/lower_test_labels.ft'], 22 test_lbl = [os.path.join(NIST_PATH,'lower/lower_test_labels.ft')],
20 indtype=theano.config.floatX, inscale=255.) 23 indtype=theano.config.floatX, inscale=255.)
21 nist_upper = FTDataSet(train_data = [NIST_PATH+'upper/upper_train_data.ft'], 24 nist_upper = FTDataSet(train_data = [os.path.join(NIST_PATH,'upper/upper_train_data.ft')],
22 train_lbl = [NIST_PATH+'upper/upper_train_labels.ft'], 25 train_lbl = [os.path.join(NIST_PATH,'upper/upper_train_labels.ft')],
23 test_data = [NIST_PATH+'upper/upper_test_data.ft'], 26 test_data = [os.path.join(NIST_PATH,'upper/upper_test_data.ft')],
24 test_lbl = [NIST_PATH+'upper/upper_test_labels.ft'], 27 test_lbl = [os.path.join(NIST_PATH,'upper/upper_test_labels.ft')],
25 indtype=theano.config.floatX, inscale=255.) 28 indtype=theano.config.floatX, inscale=255.)
26 29
27 nist_all = FTDataSet(train_data = [DATA_PATH+'train_data.ft'], 30 nist_all = FTDataSet(train_data = [os.path.join(DATA_PATH,'train_data.ft')],
28 train_lbl = [DATA_PATH+'train_labels.ft'], 31 train_lbl = [os.path.join(DATA_PATH,'train_labels.ft')],
29 test_data = [DATA_PATH+'test_data.ft'], 32 test_data = [os.path.join(DATA_PATH,'test_data.ft')],
30 test_lbl = [DATA_PATH+'test_labels.ft'], 33 test_lbl = [os.path.join(DATA_PATH,'test_labels.ft')],
31 valid_data = [DATA_PATH+'valid_data.ft'], 34 valid_data = [os.path.join(DATA_PATH,'valid_data.ft')],
32 valid_lbl = [DATA_PATH+'valid_labels.ft'], 35 valid_lbl = [os.path.join(DATA_PATH,'valid_labels.ft')],
33 indtype=theano.config.floatX, inscale=255.) 36 indtype=theano.config.floatX, inscale=255.)
34 37
35 ocr = FTDataSet(train_data = [DATA_PATH+'ocr_train_data.ft'], 38 ocr = FTDataSet(train_data = [os.path.join(DATA_PATH,'ocr_train_data.ft')],
36 train_lbl = [DATA_PATH+'ocr_train_labels.ft'], 39 train_lbl = [os.path.join(DATA_PATH,'ocr_train_labels.ft')],
37 test_data = [DATA_PATH+'ocr_test_data.ft'], 40 test_data = [os.path.join(DATA_PATH,'ocr_test_data.ft')],
38 test_lbl = [DATA_PATH+'ocr_test_labels.ft'], 41 test_lbl = [os.path.join(DATA_PATH,'ocr_test_labels.ft')],
39 valid_data = [DATA_PATH+'ocr_valid_data.ft'], 42 valid_data = [os.path.join(DATA_PATH,'ocr_valid_data.ft')],
40 valid_lbl = [DATA_PATH+'ocr_valid_labels.ft'], 43 valid_lbl = [os.path.join(DATA_PATH,'ocr_valid_labels.ft')],
41 indtype=theano.config.floatX, inscale=255.) 44 indtype=theano.config.floatX, inscale=255.)
42 45
43 nist_P07 = FTDataSet(train_data = [DATA_PATH+'data/P07_train'+str(i)+'_data.ft' for i in range(100)], 46 nist_P07 = FTDataSet(train_data = [os.path.join(DATA_PATH,'data/P07_train'+str(i)+'_data.ft') for i in range(100)],
44 train_lbl = [DATA_PATH+'data/P07_train'+str(i)+'_labels.ft' for i in range(100)], 47 train_lbl = [os.path.join(DATA_PATH,'data/P07_train'+str(i)+'_labels.ft') for i in range(100)],
45 test_data = [DATA_PATH+'data/P07_test_data.ft'], 48 test_data = [os.path.join(DATA_PATH,'data/P07_test_data.ft')],
46 test_lbl = [DATA_PATH+'data/P07_test_labels.ft'], 49 test_lbl = [os.path.join(DATA_PATH,'data/P07_test_labels.ft')],
47 valid_data = [DATA_PATH+'data/P07_valid_data.ft'], 50 valid_data = [os.path.join(DATA_PATH,'data/P07_valid_data.ft')],
48 valid_lbl = [DATA_PATH+'data/P07_valid_labels.ft'], 51 valid_lbl = [os.path.join(DATA_PATH,'data/P07_valid_labels.ft')],
49 indtype=theano.config.floatX, inscale=255.) 52 indtype=theano.config.floatX, inscale=255.)
50 53
51 mnist = GzpklDataSet(DATA_PATH+'mnist.pkl.gz') 54 mnist = GzpklDataSet(os.path.join(DATA_PATH,'mnist.pkl.gz'))