(checkpoint, bd, n_class, n_groups)
| 56 | |
| 57 | |
| 58 | def plot_optimzed_adj(checkpoint, bd, n_class, n_groups): |
| 59 | data = checkpoint["data"].to(device) |
| 60 | adj_size = data.x.size(0) |
| 61 | row = data.edge_index[0] |
| 62 | col = data.edge_index[1] |
| 63 | |
| 64 | bd1 = bd |
| 65 | n_class = n_class |
| 66 | n_groups = n_groups |
| 67 | bd1, bd2, bd3 = my_get_bd(n_groups, n_class, bd1) |
| 68 | |
| 69 | # plot_bd(ax[0], bd1, adj_size, color='g') |
| 70 | plot_bd(ax[1], bd2, adj_size, color='g') |
| 71 | plot_bd(ax[1], bd3, adj_size, color='r') |
| 72 | ax[1].scatter(row, col, s=10, alpha=0.5, c='b') |
| 73 | ax[1].set_ylim([0, adj_size]) |
| 74 | ax[1].set_xlim([adj_size, 0]) |
| 75 | ax[1].set_xticks([]) |
| 76 | ax[1].set_yticks([]) |
| 77 | ax[1].set_title('After optimization', fontsize=font_big, fontweight="bold", y=1.02) |
| 78 | |
| 79 | def plot_hard_optimzed_adj(checkpoint, bd, n_class, n_groups): |
| 80 | data = checkpoint["data"].to(device) |
no test coverage detected