def plot_unlabeled_images_random(image_list, n, title_str, ypixels, xpixels, seed, filename):
random.seed(seed)
index_sample = random.sample(range(len(image_list)), n)
plt.figure(figsize=(2*n, 2))
plt.suptitle(title_str)
for i, ind in enumerate(index_sample):
ax = plt.subplot(1, n, i + 1)
plt.imshow(image_list[ind].reshape(ypixels, xpixels))
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_compare: given test images and their reconstruction, we plot them for visual comparison
QuickDraw_noisy_classifier.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录