def generate(epoch):
latent = np.random.uniform(-1, 1, (batch_size, 100))
generated = (get_image(latent) + 1) / 2
manifold = np.zeros((32*8, 32*8, 3), dtype=theano.config.floatX)
for indx in range(8):
for indy in range(8):
current_img = np.swapaxes(generated[indx * 8 + indy], 0, 2)
current_img = np.swapaxes(current_img, 0, 1)
manifold[indx * 32:(indx+1) * 32, indy * 32:(indy+1) * 32, :] = current_img
manifold = np.asarray(manifold * 255, dtype='int32')
manifold = scipy.misc.toimage(manifold, cmin=0, cmax=255)
scipy.misc.imsave(result_folder + str(epoch) + '.png', manifold)
#================Train================#
# pretrain()
评论列表
文章目录