Closed boersmamarcel closed 5 years ago
I don't know why, but I also had problems with tf via JupyterNotebook, hence, I'd marked these cells as "Raw" ones, that's why you could not see them in pyCharm. I used skip_gram Python file for preilementary testing.
@AlexWorldD thanks for pointing me to the correct file, I extracted old code from the notebook which contained errors. Will try to run the skipgram file now and see if it works.
it works!
here a code snippet for t-sne:
fsn_embs = pd.DataFrame(list(zip(enc_dec.original_bps, embs)), columns=["ID", "Emb"])
print("Done!")
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
viz_words = 500
tsne = TSNE()
embdf = pd.DataFrame(list(map(np.ravel, fsn_embs.iloc[:,1])))
embed_tsne = tsne.fit_transform(embdf)
plt.plot(embed_tsne, 'ro')
I guess we are getting a weird visual output for tsne because of wrong feeding argument to plt.plot().
plt.plot(embed_tsne, 'ro')
vs.
plt.plot(embed_tsne[:,0], embed_tsne[:,1], 'ro')
for the second version I got the same picture as for vis with seaborn.
Excellent!!!
Kind regards,
Marcel Boersma
On Apr 12, 2019, at 3:17 PM, Alex Malyutin notifications@github.com wrote:
I guess we are getting a weird visual output for tsne because of wrong feeding argument to plt.plot(). plt.plot(embed_tsne, 'ro') vs. plt.plot(embed_tsne[:,0], embed_tsne[:,1], 'ro') for the second version I got the same picture as for vis with seaborn.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Hi Aleksei,
I couldn't find the Tensorflow code at first because in PyCharm the last cell of the notebook were not rendering correctly. Only while opening in jupyter notebook I could see the Tensorflow code.
However, I run into some problems
furthermore, I would like to render a simple t-sne plot. Could you combine this with: