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

Function plot_hard_optimzed_adj

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

Source from the content-addressed store, hash-verified

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)
81 adj_size = data.x.size(0)
82 row = data.edge_index[0]
83 col = data.edge_index[1]
84
85 bd1 = bd
86 n_class = n_class
87 n_groups = n_groups
88 bd1, bd2, bd3 = my_get_bd(n_groups, n_class, bd1)
89
90 # plot_bd(ax[0], bd1, adj_size, color='g')
91 plot_bd(ax[2], bd2, adj_size, color='g')
92 plot_bd(ax[2], bd3, adj_size, color='r')
93 ax[2].scatter(row, col, s=10, alpha=0.5, c='b')
94 ax[2].set_ylim([0, adj_size])
95 ax[2].set_xlim([adj_size, 0])
96 ax[2].set_xticks([])
97 ax[2].set_yticks([])
98 ax[2].set_title('After optimization', fontsize=font_big, fontweight="bold", y=1.02)
99
100
101def get_parameters_2_3_10(model, dataset):

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