Closed karanahujax closed 5 years ago
Those clusters are made by PCA and t-SNE, and drawn by matplotlib
. The code has not been organized for release, but I can put the core code here for temporal usage:
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
def tsne_on_pca(arr):
"""
visualize through t-sne on pca reduced data
:param arr: ndarray, (nr_examples, nr_features)
:return: ndarray, (nr_examples, 2)
"""
pca_50 = PCA(n_components=50)
res = pca_50.fit_transform(arr)
tsne_2 = TSNE(n_components=2)
res = tsne_2.fit_transform(res)
return res
# apply this function on latent vectors
Please let me know if you need further help.
Since the docs did not mention clustering:
Code for clustering: https://github.com/ChrisWu1997/2D-Motion-Retargeting/blob/master/cluster.py
Example for clustering https://github.com/ChrisWu1997/2D-Motion-Retargeting/issues/20#issuecomment-569082008
Is the code to cluster the motions into the latent space also available?