# HG changeset patch # User Dumitru Erhan # Date 1268513143 18000 # Node ID 4ce1fc11f4b24117facae1a2a2d6c9a3895dc737 # Parent 6f4e3719a3cc01bfd1a0d978d84d94513b6f5cf0# Parent 8a94a5c808cdeed42b51030af344e07b425467fc merge diff -r 8a94a5c808cd -r 4ce1fc11f4b2 datasets/defs.py --- a/datasets/defs.py Fri Mar 12 16:47:10 2010 -0500 +++ b/datasets/defs.py Sat Mar 13 15:45:43 2010 -0500 @@ -4,48 +4,51 @@ from ftfile import FTDataSet from gzpklfile import GzpklDataSet import theano - -NIST_PATH = '/data/lisa/data/nist/by_class/' -DATA_PATH = '/data/lisa/data/ift6266h10/' +import os -nist_digits = FTDataSet(train_data = [NIST_PATH+'digits/digits_train_data.ft'], - train_lbl = [NIST_PATH+'digits/digits_train_labels.ft'], - test_data = [NIST_PATH+'digits/digits_test_data.ft'], - test_lbl = [NIST_PATH+'digits/digits_test_labels.ft'], +# if the environmental variables exist, get the path from them, +# otherwise fall back on the default +NIST_PATH = os.getenv('NIST_PATH','/data/lisa/data/nist/by_class/') +DATA_PATH = os.getenv('DATA_PATH','/data/lisa/data/ift6266h10/') + +nist_digits = FTDataSet(train_data = [os.path.join(NIST_PATH,'digits/digits_train_data.ft')], + train_lbl = [os.path.join(NIST_PATH,'digits/digits_train_labels.ft')], + test_data = [os.path.join(NIST_PATH,'digits/digits_test_data.ft')], + test_lbl = [os.path.join(NIST_PATH,'digits/digits_test_labels.ft')], indtype=theano.config.floatX, inscale=255.) -nist_lower = FTDataSet(train_data = [NIST_PATH+'lower/lower_train_data.ft'], - train_lbl = [NIST_PATH+'lower/lower_train_labels.ft'], - test_data = [NIST_PATH+'lower/lower_test_data.ft'], - test_lbl = [NIST_PATH+'lower/lower_test_labels.ft'], +nist_lower = FTDataSet(train_data = [os.path.join(NIST_PATH,'lower/lower_train_data.ft')], + train_lbl = [os.path.join(NIST_PATH,'lower/lower_train_labels.ft')], + test_data = [os.path.join(NIST_PATH,'lower/lower_test_data.ft')], + test_lbl = [os.path.join(NIST_PATH,'lower/lower_test_labels.ft')], indtype=theano.config.floatX, inscale=255.) -nist_upper = FTDataSet(train_data = [NIST_PATH+'upper/upper_train_data.ft'], - train_lbl = [NIST_PATH+'upper/upper_train_labels.ft'], - test_data = [NIST_PATH+'upper/upper_test_data.ft'], - test_lbl = [NIST_PATH+'upper/upper_test_labels.ft'], +nist_upper = FTDataSet(train_data = [os.path.join(NIST_PATH,'upper/upper_train_data.ft')], + train_lbl = [os.path.join(NIST_PATH,'upper/upper_train_labels.ft')], + test_data = [os.path.join(NIST_PATH,'upper/upper_test_data.ft')], + test_lbl = [os.path.join(NIST_PATH,'upper/upper_test_labels.ft')], indtype=theano.config.floatX, inscale=255.) -nist_all = FTDataSet(train_data = [DATA_PATH+'train_data.ft'], - train_lbl = [DATA_PATH+'train_labels.ft'], - test_data = [DATA_PATH+'test_data.ft'], - test_lbl = [DATA_PATH+'test_labels.ft'], - valid_data = [DATA_PATH+'valid_data.ft'], - valid_lbl = [DATA_PATH+'valid_labels.ft'], +nist_all = FTDataSet(train_data = [os.path.join(DATA_PATH,'train_data.ft')], + train_lbl = [os.path.join(DATA_PATH,'train_labels.ft')], + test_data = [os.path.join(DATA_PATH,'test_data.ft')], + test_lbl = [os.path.join(DATA_PATH,'test_labels.ft')], + valid_data = [os.path.join(DATA_PATH,'valid_data.ft')], + valid_lbl = [os.path.join(DATA_PATH,'valid_labels.ft')], indtype=theano.config.floatX, inscale=255.) -ocr = FTDataSet(train_data = [DATA_PATH+'ocr_train_data.ft'], - train_lbl = [DATA_PATH+'ocr_train_labels.ft'], - test_data = [DATA_PATH+'ocr_test_data.ft'], - test_lbl = [DATA_PATH+'ocr_test_labels.ft'], - valid_data = [DATA_PATH+'ocr_valid_data.ft'], - valid_lbl = [DATA_PATH+'ocr_valid_labels.ft'], +ocr = FTDataSet(train_data = [os.path.join(DATA_PATH,'ocr_train_data.ft')], + train_lbl = [os.path.join(DATA_PATH,'ocr_train_labels.ft')], + test_data = [os.path.join(DATA_PATH,'ocr_test_data.ft')], + test_lbl = [os.path.join(DATA_PATH,'ocr_test_labels.ft')], + valid_data = [os.path.join(DATA_PATH,'ocr_valid_data.ft')], + valid_lbl = [os.path.join(DATA_PATH,'ocr_valid_labels.ft')], indtype=theano.config.floatX, inscale=255.) -nist_P07 = FTDataSet(train_data = [DATA_PATH+'data/P07_train'+str(i)+'_data.ft' for i in range(100)], - train_lbl = [DATA_PATH+'data/P07_train'+str(i)+'_labels.ft' for i in range(100)], - test_data = [DATA_PATH+'data/P07_test_data.ft'], - test_lbl = [DATA_PATH+'data/P07_test_labels.ft'], - valid_data = [DATA_PATH+'data/P07_valid_data.ft'], - valid_lbl = [DATA_PATH+'data/P07_valid_labels.ft'], +nist_P07 = FTDataSet(train_data = [os.path.join(DATA_PATH,'data/P07_train'+str(i)+'_data.ft') for i in range(100)], + train_lbl = [os.path.join(DATA_PATH,'data/P07_train'+str(i)+'_labels.ft') for i in range(100)], + test_data = [os.path.join(DATA_PATH,'data/P07_test_data.ft')], + test_lbl = [os.path.join(DATA_PATH,'data/P07_test_labels.ft')], + valid_data = [os.path.join(DATA_PATH,'data/P07_valid_data.ft')], + valid_lbl = [os.path.join(DATA_PATH,'data/P07_valid_labels.ft')], indtype=theano.config.floatX, inscale=255.) -mnist = GzpklDataSet(DATA_PATH+'mnist.pkl.gz') +mnist = GzpklDataSet(os.path.join(DATA_PATH,'mnist.pkl.gz'))