comparison datasets/defs.py @ 269:4533350d7361

Ajout d'une fonctionnalite pour pouvoir definir un range de fichiers d'entrainement de P07 utilises. Utile pour pre-entrainer et fine-tuner avec des donnees differentes
author SylvainPL <sylvain.pannetier.lebeuf@umontreal.ca>
date Sat, 20 Mar 2010 10:19:11 -0400
parents 966272e7f14b
children 22efb4968054
comparison
equal deleted inserted replaced
268:b077d9e97a3b 269:4533350d7361
41 test_lbl = [os.path.join(DATA_PATH,'ocr_test_labels.ft')], 41 test_lbl = [os.path.join(DATA_PATH,'ocr_test_labels.ft')],
42 valid_data = [os.path.join(DATA_PATH,'ocr_valid_data.ft')], 42 valid_data = [os.path.join(DATA_PATH,'ocr_valid_data.ft')],
43 valid_lbl = [os.path.join(DATA_PATH,'ocr_valid_labels.ft')], 43 valid_lbl = [os.path.join(DATA_PATH,'ocr_valid_labels.ft')],
44 indtype=theano.config.floatX, inscale=255., maxsize=maxsize) 44 indtype=theano.config.floatX, inscale=255., maxsize=maxsize)
45 45
46 nist_P07 = lambda maxsize=None: FTDataSet(train_data = [os.path.join(DATA_PATH,'data/P07_train'+str(i)+'_data.ft') for i in range(100)], 46 #There is 2 more arguments here to can choose smaller datasets based on the file number.
47 train_lbl = [os.path.join(DATA_PATH,'data/P07_train'+str(i)+'_labels.ft') for i in range(100)], 47 #This is usefull to get different data for pre-training and finetuning
48 nist_P07 = lambda maxsize=None, min_file=0, max_file=100: FTDataSet(train_data = [os.path.join(DATA_PATH,'data/P07_train'+str(i)+'_data.ft') for i in range(min_file, max_file)],
49 train_lbl = [os.path.join(DATA_PATH,'data/P07_train'+str(i)+'_labels.ft') for i in range(min_file, max_file)],
48 test_data = [os.path.join(DATA_PATH,'data/P07_test_data.ft')], 50 test_data = [os.path.join(DATA_PATH,'data/P07_test_data.ft')],
49 test_lbl = [os.path.join(DATA_PATH,'data/P07_test_labels.ft')], 51 test_lbl = [os.path.join(DATA_PATH,'data/P07_test_labels.ft')],
50 valid_data = [os.path.join(DATA_PATH,'data/P07_valid_data.ft')], 52 valid_data = [os.path.join(DATA_PATH,'data/P07_valid_data.ft')],
51 valid_lbl = [os.path.join(DATA_PATH,'data/P07_valid_labels.ft')], 53 valid_lbl = [os.path.join(DATA_PATH,'data/P07_valid_labels.ft')],
52 indtype=theano.config.floatX, inscale=255., maxsize=maxsize) 54 indtype=theano.config.floatX, inscale=255., maxsize=maxsize)