Skip to content

Commit

Permalink
Merge pull request #4851 from BaffinLee/fix/fix-gop-visualize-error
Browse files Browse the repository at this point in the history
[egs] convert tuple to NDArray before call sklearn.manifold.TSNE
  • Loading branch information
danpovey authored Nov 13, 2023
2 parents a611d7b + 039ccbf commit 545b1f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions egs/gop_speechocean762/s5/local/visualize_feats.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import random
import kaldi_io
import seaborn as sns
import numpy as np
from collections import Counter
from sklearn.manifold import TSNE
from utils import load_human_scores, load_phone_symbol_table
Expand Down Expand Up @@ -62,6 +63,9 @@ def main():
min(args.samples, len(lables)))
features, lables = list(zip(*sampled_paris))

# Convert the tuple of arrays to a single 2D array
features = np.vstack(features)

# Draw scatters
label_counter = Counter(lables)
colors = sns.color_palette("colorblind", len(label_counter))
Expand Down

0 comments on commit 545b1f1

Please sign in to comment.