| 40 | ax.plot([y, y], [x, z], c=color, lw=5, alpha=0.6) |
| 41 | |
| 42 | def plot_raw_adj(data): |
| 43 | edge_attr = torch.ones(data.edge_index[0].size(0)) |
| 44 | eye = torch.eye(data.x.size(0)).to_sparse().to(device) |
| 45 | oriadj = SparseTensor(row=data.edge_index[0], col=data.edge_index[1], value=torch.clone(edge_attr)).to_torch_sparse_coo_tensor() |
| 46 | oriadj = SparseTensor.from_torch_sparse_coo_tensor(oriadj + eye) |
| 47 | row, col, value = oriadj.coo() |
| 48 | adj_size = data.x.size(0) |
| 49 | |
| 50 | ax[0].scatter(row, col, s=10, alpha=0.5, c='b') |
| 51 | ax[0].set_ylim([0, adj_size]) |
| 52 | ax[0].set_xlim([adj_size, 0]) |
| 53 | ax[0].set_xticks([]) |
| 54 | ax[0].set_yticks([]) |
| 55 | ax[0].set_title('Before optimization', fontsize=font_big, fontweight="bold", y=1.02) |
| 56 | |
| 57 | |
| 58 | def plot_optimzed_adj(checkpoint, bd, n_class, n_groups): |