test_loader = DataLoader(test_data, batch_size=args.batch_size, shuffle=True) print('Finish loading the data....') if not args.aligned: print("### Note: You are running in unaligned mode.") #################################################################### # # Hyperparameters # #################################################################### hyp_params = args hyp_params.orig_d_l, hyp_params.orig_d_a, hyp_params.orig_d_v = train_data.get_dim( ) hyp_params.l_len, hyp_params.a_len, hyp_params.v_len = train_data.get_seq_len() hyp_params.layers = args.nlevels hyp_params.use_cuda = use_cuda hyp_params.dataset = dataset hyp_params.when = args.when hyp_params.batch_chunk = args.batch_chunk hyp_params.n_train, hyp_params.n_valid, hyp_params.n_test = len( train_data), len(valid_data), len(test_data) hyp_params.model = str.upper(args.model.strip()) hyp_params.output_dim = output_dim_dict.get(dataset, 1) hyp_params.criterion = criterion_dict.get(dataset, 'L1Loss') if __name__ == '__main__': test_loss = train.initiate(hyp_params, train_loader, valid_loader, test_loader)
def main(): params = load_config(args) params, train_loader, valid_loader, test_loader = load_data_pipeline(params) save_config(params) test_loss = train.initiate(params, train_loader, valid_loader, test_loader)