def no_test_raw_collate(): import matplotlib.pyplot as plt from test_utils import plot, plot_spec data_id_path = "data_dir/" data_path = "data_dir/" print(hp.seq_len) with open('{}dataset_ids.pkl'.format(data_id_path), 'rb') as f: dataset_ids = pickle.load(f) dataset = AudiobookDataset(data_path) print(len(dataset)) data_loader = DataLoader(dataset, collate_fn=raw_collate, batch_size=32, num_workers=0, shuffle=True) x, m, y = next(iter(data_loader)) print(x.shape, m.shape, y.shape) plot(x.numpy()[0]) plot(y.numpy()[0]) plot_spec(m.numpy()[0])
title_dict = {'dist': 'Decoy distance', 'rmsd': 'Decoy RMSD'} sum_dict = {'percent_improved': 'percentage of improved decoys'} x_dict = { 'pre_dist_sum': 'Initial Cα distance', 'pre_rmsd_sum': 'Initial RMSD' } y_dict = { 'post_dist_sum': 'Cα distance after mover', 'post_rmsd_sum': 'RMSD after mover' } #title = title_dict[mid] + ' comparison summarized by ' + sum_dict[summary] title = '' plt, fig, ax = plot(data, groups=groups, xlabel=x_dict[x], ylabel=y_dict[y], title=title, unitline=unitline, markersize=5) def on_pick(event): if not hasattr(event, 'ind'): return True ind = event.ind #for a, b in enumerate(ind): data = event.artist.get_offsets() if event.artist.get_label() == 'constrained': pick_df = df_cst else: pick_df = df_uncst