MCPcopy Create free account
hub / github.com/BladeDancer957/CPFD / plot_centers

Function plot_centers

src/utils.py:306–321  ·  view source on GitHub ↗

Plot the feature centers X Params: - X: a feature matrix has dims (num_classes, hidden_dims) - label_list: a list has dims (num_samples) and it represents the name of each class

(X, label_list)

Source from the content-addressed store, hash-verified

304 cmap=plt.cm.Spectral)
305
306def plot_centers(X, label_list):
307 '''
308 Plot the feature centers X
309
310 Params:
311 - X: a feature matrix has dims (num_classes, hidden_dims)
312 - label_list: a list has dims (num_samples)
313 and it represents the name of each class
314 '''
315 plt.scatter(X[:,0], X[:,1],
316 c=[i+1 for i in range(X.shape[0])],
317 marker='*')
318 for i, l_name in enumerate(label_list):
319 plt.text(X[i,0], X[i,1],
320 s=str(l_name),
321 size=15)
322
323def plot_distribution(X, Y, label_list, class_center_matrix=None, sample_ratio=1.0, select_labels=None):
324 '''

Callers 1

plot_distributionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected