Created
November 20, 2017 13:05
-
-
Save fedden/db2fa39b20867d6f925bd09de033bdb5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.manifold import TSNE | |
from sklearn.preprocessing import MinMaxScaler | |
def get_scaled_tsne_embeddings(features, perplexity, iteration): | |
embedding = TSNE(n_components=2, | |
perplexity=perplexity, | |
n_iter=iteration).fit_transform(features) | |
scaler = MinMaxScaler() | |
scaler.fit(embedding) | |
return scaler.transform(embedding) | |
tnse_embeddings_mfccs = [] | |
tnse_embeddings_wavenet = [] | |
perplexities = [2, 5, 30, 50, 100] | |
iterations = [200, 500, 1000, 2000, 5000] | |
for perplexity in perplexities: | |
for iteration in iterations: | |
tsne_mfccs = get_scaled_tsne_embeddings(mfcc_features, | |
perplexity, | |
iteration) | |
tnse_wavenet = get_scaled_tsne_embeddings(wavenet_features, | |
perplexity, | |
iteration) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment