Skip to content

Instantly share code, notes, and snippets.

@mmeendez8
Created January 24, 2019 10:53
Show Gist options
  • Select an option

  • Save mmeendez8/aa5b73d6d64cf5e1ceba31472a1ebf64 to your computer and use it in GitHub Desktop.

Select an option

Save mmeendez8/aa5b73d6d64cf5e1ceba31472a1ebf64 to your computer and use it in GitHub Desktop.
# Create mesh grid of values
values = np.arange(-3, 4, .5)
xx, yy = np.meshgrid(values, values)
input_holder = np.zeros((1, 2))
# Matrix that will contain the grid of images
container = np.zeros((28 * len(values), 28 * len(values)))
for row in range(xx.shape[0]):
for col in range(xx.shape[1]):
input_holder[0, :] = [xx[row, col], yy[row, col]]
artificial_image = sess.run(output, feed_dict={z: input_holder})
container[row * 28: (row + 1) * 28, col * 28: (col + 1) * 28] = np.squeeze(artificial_image)
plt.imshow(container, cmap='gray')
plt.savefig(os.path.join(results_folder, 'Test/Space_{}'.format(epoch)))
plt.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment