Skip to content

Commit 545b1f1

Browse files
authoredNov 13, 2023
Merge pull request kaldi-asr#4851 from BaffinLee/fix/fix-gop-visualize-error
[egs] convert tuple to NDArray before call sklearn.manifold.TSNE
2 parents a611d7b + 039ccbf commit 545b1f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎egs/gop_speechocean762/s5/local/visualize_feats.py

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import random
99
import kaldi_io
1010
import seaborn as sns
11+
import numpy as np
1112
from collections import Counter
1213
from sklearn.manifold import TSNE
1314
from utils import load_human_scores, load_phone_symbol_table
@@ -62,6 +63,9 @@ def main():
6263
min(args.samples, len(lables)))
6364
features, lables = list(zip(*sampled_paris))
6465

66+
# Convert the tuple of arrays to a single 2D array
67+
features = np.vstack(features)
68+
6569
# Draw scatters
6670
label_counter = Counter(lables)
6771
colors = sns.color_palette("colorblind", len(label_counter))

0 commit comments

Comments
 (0)
Please sign in to comment.