@@ -603,26 +603,30 @@ def divide_x_y_by_lenth(X_train,y_train,lenth):
603
603
604
604
605
605
log = pd .DataFrame (hist .history )
606
- log .to_excel (r"F:\桌面11.17\project\fluid_based_time_series_calssification\ experiments_result\ log\ {}_dataset_{}_log{}_time{}.xlsx" .format (method_name ,str (flist .index (each )),i ,datetime .datetime .now ().strftime ('%Y%m%d%H%M%S' )))
606
+ log .to_excel (last_last_path + r"/ experiments_result/ log/ {}_dataset_{}_log{}_time{}.xlsx" .format (method_name ,str (flist .index (each )),i ,datetime .datetime .now ().strftime ('%Y%m%d%H%M%S' )))
607
607
608
- print (log .loc [log [syn_loss ].idxmin ][syn_loss ], log .loc [log [syn_loss ].idxmin ][syn_val_acc ])
609
- error_record .append (1 - log .loc [log [syn_loss ].idxmin ][syn_val_acc ])
610
- loss_record .append (log .loc [log [syn_loss ].idxmin ][syn_loss ])
608
+ print (log .loc [log [syn_loss ].idxmin () ][syn_loss ], log .loc [log [syn_loss ].idxmin () ][syn_val_acc ])
609
+ error_record .append (1 - log .loc [log [syn_loss ].idxmin () ][syn_val_acc ])
610
+ loss_record .append (log .loc [log [syn_loss ].idxmin () ][syn_loss ])
611
611
# with open(r"F:\桌面11.17\project\fluid_based_time_series_calssification\experiments_result\log\{}_dataset_{}_log{}.txt".format(method_name,str(flist.index(each)),i), 'wb') as file_txt:
612
612
## with open(r"F:\桌面11.17\project\fluid_based_time_series_calssification\experiments_result\log\{}_dataset_{}_log{}_time{}.txt".format(method_name,str(flist.index(each)),i,str(datetime.datetime.now())), 'wb') as file_txt:
613
613
# pickle.dump(hist.history, file_txt)
614
614
615
- file = open (r"F:\桌面11.17\project\fluid_based_time_series_calssification\ experiments_result\ method_error_txt\ {}.txt" .format (method_name ), 'a' )
616
- # file.write( str(flist.index(each))+'error:'+' '+str('%.5f'%(1-log.loc[log[syn_loss].idxmin][syn_val_acc]))+' ')
617
- file .write ( str (flist .index (each ))+ 'error:' + ' ' + str ('%.5f' % (1 - log .loc [log [syn_loss ].idxmin ][syn_val_acc ]))+ ' ' + 'loss:' + str ('%.8f' % (log .loc [log [syn_loss ].idxmin ][syn_loss ]))+ ' ' )
618
- # file.write( 'error:'+' '+str('%.5f'%(1-log.loc[log['loss'].idxmin]['val_acc']))+' '+'corresponding_min_loss:'+' '+str('%.5f'%log.loc[log['loss'].idxmin]['loss']) +' '+str(flist.index(each))+' ' +each +'\n')
619
- # file.write( 'error:'+' '+str('%.5f'%(1-log.loc[log['loss'].idxmin]['val_acc']))+' '+'corresponding_min_loss:'+' '+str('%.5f'%log.loc[log['loss'].idxmin]['loss']) +' '+str(flist.index(each))+' ' +each +'\n')
615
+ file = open (last_last_path + r"/ experiments_result/ method_error_txt/ {}.txt" .format (method_name ), 'a' )
616
+ # file.write( str(flist.index(each))+'error:'+' '+str('%.5f'%(1-log.loc[log[syn_loss].idxmin() ][syn_val_acc]))+' ')
617
+ file .write ( str (flist .index (each ))+ 'error:' + ' ' + str ('%.5f' % (1 - log .loc [log [syn_loss ].idxmin () ][syn_val_acc ]))+ ' ' + 'loss:' + str ('%.8f' % (log .loc [log [syn_loss ].idxmin () ][syn_loss ]))+ ' ' )
618
+ # file.write( 'error:'+' '+str('%.5f'%(1-log.loc[log['loss'].idxmin() ]['val_acc']))+' '+'corresponding_min_loss:'+' '+str('%.5f'%log.loc[log['loss'].idxmin() ]['loss']) +' '+str(flist.index(each))+' ' +each +'\n')
619
+ # file.write( 'error:'+' '+str('%.5f'%(1-log.loc[log['loss'].idxmin() ]['val_acc']))+' '+'corresponding_min_loss:'+' '+str('%.5f'%log.loc[log['loss'].idxmin() ]['loss']) +' '+str(flist.index(each))+' ' +each +'\n')
620
620
621
621
file .close ()
622
622
623
623
print ('!!!!!!!!!!!!!!!! {} {} {}::runtime:{}____min_error:{}' .format (method_name ,num ,each ,i ,'%.5f' % min (error_record )))
624
-
625
- file = open (r"F:\桌面11.17\project\fluid_based_time_series_calssification\experiments_result\method_error_txt\{}.txt" .format (method_name ), 'a' )
624
+ keras .backend .clear_session ()
625
+ if (1 - log .loc [log [syn_loss ].idxmin ()][syn_val_acc ])== 0 :
626
+
627
+ break
628
+ keras .backend .clear_session ()
629
+ file = open (last_last_path + r"/experiments_result/method_error_txt/{}.txt" .format (method_name ), 'a' )
626
630
file .write ('min_error:' + ' ' + str ('%.5f' % (min (error_record )))+ ' ' + ' ' + str (flist .index (each ))+ ' ' + each + '\n ' )
627
631
file .close ()
628
632
error_record = []
@@ -657,4 +661,4 @@ def divide_x_y_by_lenth(X_train,y_train,lenth):
657
661
# plt.colorbar();
658
662
# # pp.savefig()
659
663
# #
660
- # # pp.close()
664
+ # # pp.close()
0 commit comments