comparison deep/stacked_dae/v_sylvain/nist_sda.py @ 312:bd6085d77706

Avoir exactement le meme jeu de donnees pour pre-train et finetune
author SylvainPL <sylvain.pannetier.lebeuf@umontreal.ca>
date Thu, 01 Apr 2010 14:25:40 -0400
parents ed0443f7aad4
children 8de3bef71458
comparison
equal deleted inserted replaced
311:8b31280129a9 312:bd6085d77706
104 #Decide how the finetune is done 104 #Decide how the finetune is done
105 105
106 if finetune_choice == 0: 106 if finetune_choice == 0:
107 print('\n\n\tfinetune with NIST\n\n') 107 print('\n\n\tfinetune with NIST\n\n')
108 optimizer.reload_parameters('params_pretrain.txt') 108 optimizer.reload_parameters('params_pretrain.txt')
109 optimizer.finetune(datasets.nist_all(),datasets.nist_P07(min_file=nb_file),max_finetune_epoch_NIST,ind_test=1) 109 optimizer.finetune(datasets.nist_all(),datasets.nist_P07(),max_finetune_epoch_NIST,ind_test=1)
110 channel.save() 110 channel.save()
111 if finetune_choice == 1: 111 if finetune_choice == 1:
112 print('\n\n\tfinetune with P07\n\n') 112 print('\n\n\tfinetune with P07\n\n')
113 optimizer.reload_parameters('params_pretrain.txt') 113 optimizer.reload_parameters('params_pretrain.txt')
114 optimizer.finetune(datasets.nist_P07(min_file=nb_file),datasets.nist_all(),max_finetune_epoch_P07,ind_test=0) 114 optimizer.finetune(datasets.nist_P07(),datasets.nist_all(),max_finetune_epoch_P07,ind_test=0)
115 channel.save() 115 channel.save()
116 if finetune_choice == 2: 116 if finetune_choice == 2:
117 print('\n\n\tfinetune with NIST followed by P07\n\n') 117 print('\n\n\tfinetune with NIST followed by P07\n\n')
118 optimizer.reload_parameters('params_pretrain.txt') 118 optimizer.reload_parameters('params_pretrain.txt')
119 optimizer.finetune(datasets.nist_all(),datasets.nist_P07(min_file=nb_file),max_finetune_epoch_NIST,ind_test=21) 119 optimizer.finetune(datasets.nist_all(),datasets.nist_P07(),max_finetune_epoch_NIST,ind_test=21)
120 optimizer.finetune(datasets.nist_P07(min_file=nb_file),datasets.nist_all(),max_finetune_epoch_P07,ind_test=20) 120 optimizer.finetune(datasets.nist_P07(),datasets.nist_all(),max_finetune_epoch_P07,ind_test=20)
121 channel.save() 121 channel.save()
122 if finetune_choice == 3: 122 if finetune_choice == 3:
123 print('\n\n\tfinetune with NIST only on the logistic regression on top (but validation on P07).\n\ 123 print('\n\n\tfinetune with NIST only on the logistic regression on top (but validation on P07).\n\
124 All hidden units output are input of the logistic regression\n\n') 124 All hidden units output are input of the logistic regression\n\n')
125 optimizer.reload_parameters('params_pretrain.txt') 125 optimizer.reload_parameters('params_pretrain.txt')
126 optimizer.finetune(datasets.nist_all(),datasets.nist_P07(min_file=nb_file),max_finetune_epoch_NIST,ind_test=1,special=1) 126 optimizer.finetune(datasets.nist_all(),datasets.nist_P07(),max_finetune_epoch_NIST,ind_test=1,special=1)
127 127
128 128
129 if finetune_choice==-1: 129 if finetune_choice==-1:
130 print('\nSERIE OF 3 DIFFERENT FINETUNINGS') 130 print('\nSERIE OF 3 DIFFERENT FINETUNINGS')
131 print('\n\n\tfinetune with NIST\n\n') 131 print('\n\n\tfinetune with NIST\n\n')
132 optimizer.reload_parameters('params_pretrain.txt') 132 optimizer.reload_parameters('params_pretrain.txt')
133 optimizer.finetune(datasets.nist_all(),datasets.nist_P07(min_file=nb_file),max_finetune_epoch_NIST,ind_test=1) 133 optimizer.finetune(datasets.nist_all(),datasets.nist_P07(),max_finetune_epoch_NIST,ind_test=1)
134 channel.save() 134 channel.save()
135 print('\n\n\tfinetune with P07\n\n') 135 print('\n\n\tfinetune with P07\n\n')
136 optimizer.reload_parameters('params_pretrain.txt') 136 optimizer.reload_parameters('params_pretrain.txt')
137 optimizer.finetune(datasets.nist_P07(min_file=nb_file),datasets.nist_all(),max_finetune_epoch_P07,ind_test=0) 137 optimizer.finetune(datasets.nist_P07(),datasets.nist_all(),max_finetune_epoch_P07,ind_test=0)
138 channel.save() 138 channel.save()
139 print('\n\n\tfinetune with NIST (done earlier) followed by P07 (written here)\n\n') 139 print('\n\n\tfinetune with NIST (done earlier) followed by P07 (written here)\n\n')
140 optimizer.reload_parameters('params_finetune_NIST.txt') 140 optimizer.reload_parameters('params_finetune_NIST.txt')
141 optimizer.finetune(datasets.nist_P07(min_file=nb_file),datasets.nist_all(),max_finetune_epoch_P07,ind_test=20) 141 optimizer.finetune(datasets.nist_P07(),datasets.nist_all(),max_finetune_epoch_P07,ind_test=20)
142 channel.save() 142 channel.save()
143 print('\n\n\tfinetune with NIST only on the logistic regression on top.\n\ 143 print('\n\n\tfinetune with NIST only on the logistic regression on top.\n\
144 All hidden units output are input of the logistic regression\n\n') 144 All hidden units output are input of the logistic regression\n\n')
145 optimizer.reload_parameters('params_pretrain.txt') 145 optimizer.reload_parameters('params_pretrain.txt')
146 optimizer.finetune(datasets.nist_all(),datasets.nist_P07(min_file=nb_file),max_finetune_epoch_NIST,ind_test=1,special=1) 146 optimizer.finetune(datasets.nist_all(),datasets.nist_P07(),max_finetune_epoch_NIST,ind_test=1,special=1)
147 channel.save() 147 channel.save()
148 148
149 channel.save() 149 channel.save()
150 150
151 return channel.COMPLETE 151 return channel.COMPLETE