def sample_images(self, epoch):
    (r, c) = (5, 5)
    noise = np.random.normal(0, 1, ((r * c), self.latent_dim))
    gen_imgs = self.generator.predict(noise)
    gen_imgs = ((0.5 * gen_imgs) + 0.5)
    (fig, axs) = plt.subplots(r, c)
    cnt = 0
    for i in range(r):
        for j in range(c):
            axs[(i, j)].imshow(gen_imgs[cnt, :, :, 0], cmap='gray')
            axs[(i, j)].axis('off')
            cnt += 1
    fig.savefig(('images/mnist_%d.png' % epoch))
    plt.close()
def sample_images(self, epoch):
    (r, c) = (5, 5)
    noise = np.random.normal(0, 1, ((r * c), self.latent_dim))
    gen_imgs = self.generator.predict(noise)
    gen_imgs = ((0.5 * gen_imgs) + 0.5)
    (fig, axs) = plt.subplots(r, c)
    cnt = 0
    for i in range(r):
        for j in range(c):
            axs[(i, j)].imshow(gen_imgs[cnt, :, :, 0], cmap='gray')
            axs[(i, j)].axis('off')
            cnt += 1
    fig.savefig(('images/mnist_%d.png' % epoch))
    plt.close()