MCPcopy Create free account
hub / github.com/GATECH-EIC/GCoD / plot_optimzed_adj

Function plot_optimzed_adj

plot_adj.py:58–77  ·  view source on GitHub ↗
(checkpoint, bd, n_class, n_groups)

Source from the content-addressed store, hash-verified

56
57
58def 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
79def plot_hard_optimzed_adj(checkpoint, bd, n_class, n_groups):
80 data = checkpoint["data"].to(device)

Callers 1

plot_adj.pyFile · 0.85

Calls 3

my_get_bdFunction · 0.90
plot_bdFunction · 0.85
toMethod · 0.45

Tested by

no test coverage detected