comparison baseline_algorithms/mlp/mlp_nist.py @ 145:8ceaaf812891

changed adaptive lr flag from bool to int for jobman issues
author XavierMuller
date Tue, 23 Feb 2010 18:23:47 -0500
parents f341a4efb44a
children
comparison
equal deleted inserted replaced
144:c958941c1b9d 145:8ceaaf812891
161 else: 161 else:
162 raise NotImplementedError() 162 raise NotImplementedError()
163 163
164 164
165 def mlp_full_nist( verbose = False,\ 165 def mlp_full_nist( verbose = False,\
166 adaptive_lr = False,\ 166 adaptive_lr = 0,\
167 train_data = 'all/all_train_data.ft',\ 167 train_data = 'all/all_train_data.ft',\
168 train_labels = 'all/all_train_labels.ft',\ 168 train_labels = 'all/all_train_labels.ft',\
169 test_data = 'all/all_test_data.ft',\ 169 test_data = 'all/all_test_data.ft',\
170 test_labels = 'all/all_test_labels.ft',\ 170 test_labels = 'all/all_test_labels.ft',\
171 learning_rate=0.01,\ 171 learning_rate=0.01,\
397 elif this_validation_loss >= best_validation_loss: 397 elif this_validation_loss >= best_validation_loss:
398 #calculate the test error at this point and exit 398 #calculate the test error at this point and exit
399 # test it on the test set 399 # test it on the test set
400 # however, if adaptive_lr is true, try reducing the lr to 400 # however, if adaptive_lr is true, try reducing the lr to
401 # get us out of an oscilliation 401 # get us out of an oscilliation
402 if adaptive_lr==True: 402 if adaptive_lr==1:
403 classifier.lr.value=classifier.lr.value/2.0 403 classifier.lr.value=classifier.lr.value/2.0
404 404
405 test_score = 0. 405 test_score = 0.
406 #cap the patience so we are allowed one more validation error 406 #cap the patience so we are allowed one more validation error
407 #calculation before aborting 407 #calculation before aborting