MCPcopy Create free account
hub / github.com/VisionLearningGroup/OVANet / plot_embedding2

Function plot_embedding2

utils/tsne_visualize_labeled.py:37–58  ·  view source on GitHub ↗
(X, label, title=None)

Source from the content-addressed store, hash-verified

35 plt.savefig(title)
36 return X#(X - x_min) / (x_max - x_min)
37def plot_embedding2(X, label, title=None):
38 plt.figure()
39 ax = plt.subplot(111)
40 color_dict = {0:'b',1:'r'}
41 inds2 = np.where(label==2)[0]
42 inds1 = np.where(label==1)[0]
43 inds0 = np.where(label==0)[0]
44 plt.scatter(X[inds0, 0], X[inds0, 1],color='r',alpha=0.1)
45 #inds = np.where(label == 1)[0]
46 plt.scatter(X[inds1, 0], X[inds1, 1], color='b', alpha=0.1)
47 plt.scatter(X[inds2, 0], X[inds2, 1], color='g', alpha=0.1)
48 ax.tick_params(labelbottom="off", bottom="off")
49 ax.tick_params(labelleft="off", left="off")
50 plt.tick_params(color='white')
51 ax.spines["right"].set_color("none")
52 ax.spines["left"].set_color("none")
53 ax.spines["top"].set_color("none")
54 ax.spines["bottom"].set_color("none")
55 #ax.legend(loc='upper left')
56 #plt.legend()
57 plt.savefig(title)
58 return X # (X - x_min) / (x_max - x_min)
59X_t = np.load(args[1])#[:,:500]
60rand_v = np.random.permutation(X_t.shape[0])
61#X_t = X_t[rand_v[:5000]]

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected