) else: raise RuntimeError('Please check the args of python command line.') his_label.append(sys_argv[i].replace('.csv', '') + '_train') his_label.append(sys_argv[i].replace('.csv', '') + '_test') return his, his_label if __name__ == '__main__': if len(sys.argv) < 3: print( 'Usage: python3 plot_his_RL.py [image name] [csv file 1] [csv file 2] ...' ) exit(0) dataframe_list = [] args = [] for i in range(2, len(sys.argv)): dataframe_list.append(pd.read_csv(sys.argv[i])) args.append(sys.argv[i]) his, his_label = grab_RLhis(dataframe_list, args, 'loss') TrainHistoryPlot(his, his_label, sys.argv[1] + '_loss', 'AT_loss', ['epoch', 'loss']) his, his_label = grab_RLhis(dataframe_list, args, 'acc') TrainHistoryPlot(his, his_label, sys.argv[1] + '_Acc', 'AT_Acc.', ['epoch', 'Acc.']) print('All process done.')
def grab_rate(dataframe_list, sys_argv): if len(dataframe_list) != 1: raise RuntimeError('Please check the args for only one file.') rate = [] name = [] rate.append(from_dataframe(dataframe_list[0].iloc[:, 0])) rate.append(from_dataframe(dataframe_list[0].iloc[:, 1])) name.append('sched_rate') return rate, name if __name__ == '__main__': if len(sys.argv) != 3: print('Usage: python3 plot_sched_rate.py [image name] [csv file]') exit(0) dataframe_list = [] args = [] dataframe_list.append(pd.read_csv(sys.argv[2])) args.append(sys.argv[2]) rate, name = grab_rate(dataframe_list, args) TrainHistoryPlot(rate, name, 'Sched_sampling_rate', 'Rate', ['epoch', 'rate']) print('All process done.')
) else: raise RuntimeError('Please check the args of python command line.') his_label = [ sys_argv[i].replace('his_', '').replace('.csv', '') + '_generator', sys_argv[i].replace('his_', '').replace('.csv', '') + '_discriminator' ] return his, his_label if __name__ == '__main__': if len(sys.argv) < 3: print( 'Usage: python3 plot_his_GAN.py [image name] [csv file 1] [csv file 2] ...' ) exit(0) dataframe_list = [] args = [] for i in range(2, len(sys.argv)): dataframe_list.append(pd.read_csv(sys.argv[i])) args.append(sys.argv[i]) his, his_label = grab_his(dataframe_list, args, 'loss') TrainHistoryPlot(his, his_label, sys.argv[1] + '_loss', 'Loss', ['epoch', 'loss']) print('All process done.')
'Please check the file or all trained by same training setting.' ) else: raise RuntimeError('Please check the args of python command line.') his_label.append(sys_argv[i].replace('.csv', '')) return his, his_label if __name__ == '__main__': if len(sys.argv) < 3: print( 'Usage: python3 plot_his_FT.py [image name] [csv file 1] [csv file 2] ...' ) exit(0) dataframe_list = [] args = [] for i in range(2, len(sys.argv)): dataframe_list.append(pd.read_csv(sys.argv[i])) args.append(sys.argv[i]) his, his_label = grab_FThis(dataframe_list, args, 'train') TrainHistoryPlot(his, his_label, sys.argv[1] + '_train_loss', 'FT_train_loss', ['iter', 'loss']) his, his_label = grab_FThis(dataframe_list, args, 'test') TrainHistoryPlot(his, his_label, sys.argv[1] + '_test_loss', 'FT_test_loss', ['iter', 'loss']) print('All process done.')