def plot_compare(x_test, decoded_imgs, filename):
n = 10
plt.figure(figsize=(2*n, 4))
for i in range(n):
# display original
ax = plt.subplot(2, n, i + 1)
plt.imshow(x_test[i].reshape(28, 28))
plt.gray()
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
# display reconstruction
ax = plt.subplot(2, n, i + 1 + n)
plt.imshow(decoded_imgs[i].reshape(28, 28))
plt.gray()
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
if 1:
pylab.savefig(filename, bbox_inches='tight')
else:
plt.show()
# plot_img: plots greyscale image
QuickDraw_noisy_classifier.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录