animebing / mnist_tsne Goto Github PK
View Code? Open in Web Editor NEWt-sne visualization of mnist images when feature is represented by raw pixels and cnn learned feature
t-sne visualization of mnist images when feature is represented by raw pixels and cnn learned feature
Hi,
Thank you for this code.
I got the following error during tsne_vis.ipynb. Can you please help me to sort out?
TypeError Traceback (most recent call last)
~/pytorch_new_python3/lib/python3.5/site-packages/matplotlib/colors.py in to_rgba(c, alpha)
173 try:
--> 174 rgba = _colors_full_map.cache[c, alpha]
175 except (KeyError, TypeError): # Not in cache, or unhashable.
TypeError: unhashable type: 'numpy.ndarray'
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
~/pytorch_new_python3/lib/python3.5/site-packages/matplotlib/axes/_axes.py in scatter(self, x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, **kwargs)
4231 try: # Then is 'c' acceptable as PathCollection facecolors?
-> 4232 colors = mcolors.to_rgba_array(c)
4233 n_elem = colors.shape[0]
~/pytorch_new_python3/lib/python3.5/site-packages/matplotlib/colors.py in to_rgba_array(c, alpha)
274 for i, cc in enumerate(c):
--> 275 result[i] = to_rgba(cc, alpha)
276 return result
~/pytorch_new_python3/lib/python3.5/site-packages/matplotlib/colors.py in to_rgba(c, alpha)
175 except (KeyError, TypeError): # Not in cache, or unhashable.
--> 176 rgba = _to_rgba_no_colorcycle(c, alpha)
177 try:
~/pytorch_new_python3/lib/python3.5/site-packages/matplotlib/colors.py in _to_rgba_no_colorcycle(c, alpha)
230 if len(c) not in [3, 4]:
--> 231 raise ValueError("RGBA sequence should have length 3 or 4")
232 if len(c) == 3 and alpha is None:
ValueError: RGBA sequence should have length 3 or 4
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
in
1 plt.rcParams['figure.figsize'] = 20, 20
----> 2 plt.scatter(output_2d[:, 0], output_2d[:, 1], c=target)
3 plt.savefig('train/output_2d.png', bbox_inches='tight')
4 plt.show()
~/pytorch_new_python3/lib/python3.5/site-packages/matplotlib/pyplot.py in scatter(x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, data, **kwargs)
2862 vmin=vmin, vmax=vmax, alpha=alpha, linewidths=linewidths,
2863 verts=verts, edgecolors=edgecolors, **({"data": data} if data
-> 2864 is not None else {}), **kwargs)
2865 sci(__ret)
2866 return __ret
~/pytorch_new_python3/lib/python3.5/site-packages/matplotlib/init.py in inner(ax, data, *args, **kwargs)
1808 "the Matplotlib list!)" % (label_namer, func.name),
1809 RuntimeWarning, stacklevel=2)
-> 1810 return func(ax, *args, **kwargs)
1811
1812 inner.doc = _add_data_doc(inner.doc,
~/pytorch_new_python3/lib/python3.5/site-packages/matplotlib/axes/_axes.py in scatter(self, x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, **kwargs)
4243 "acceptable for use with 'x' with size {xs}, "
4244 "'y' with size {ys}."
-> 4245 .format(nc=n_elem, xs=x.size, ys=y.size)
4246 )
4247 # Both the mapping and the RGBA conversion failed: pretty
ValueError: 'c' argument has 60000 elements, which is not acceptable for use with 'x' with size 60000, 'y' with size 60000.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.