Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why can't Multicore-TSNE speed up my experiment with mnist #93

Open
yuxiaokang-source opened this issue May 23, 2022 · 0 comments
Open

Comments

@yuxiaokang-source
Copy link

image

my test code of Multicore-TSNE is below
%%time
import numpy as np
from MulticoreTSNE import MulticoreTSNE as TSNE
from matplotlib import pyplot as plt
if __name__ == "__main__":
    data=np.load("/DATA1/zhangjingxiao/yxk/dataset/mnist/mnist.npz")
    for item in data.files:
        print(item)# find keys,the you can get value
        print(data[item].shape)
        print("=================")
    ## follow this

    X=data["x_train"].reshape(60000,-1)
    y=data["y_train"]
    print(X.shape)

    embeddings=TSNE(n_jobs=8).fit_transform(X)
    vis_x=embeddings[:,0]
    vis_y=embeddings[:,1]
    plt.scatter(vis_x,vis_y,c=y)
    plt.show()

my result is
image

my test code of TSNE in sklearn is

%%time
import numpy as np
from sklearn.manifold import TSNE 
#from MulticoreTSNE import MulticoreTSNE as TSNE
from matplotlib import pyplot as plt

data=np.load("/DATA1/zhangjingxiao/yxk/dataset/mnist/mnist.npz")
for item in data.files:
    print(item)# find keys,the you can get value
    print(data[item].shape)
    print("=================")
## follow this

X=data["x_train"].reshape(60000,-1)
y=data["y_train"]
print(X.shape)

tsne = TSNE(n_components=2, init='pca', random_state=0)
embeddings= tsne.fit_transform(X)
vis_x=embeddings[:,0]
vis_y=embeddings[:,1]
plt.scatter(vis_x,vis_y,c=y)
plt.show()

my result is below
image
It seems that mutlticore-tsne didnt speed up my experiment? Could you give me some advice about it ? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant