Skip to content

Instantly share code, notes, and snippets.

@dpoulopoulos
Created September 29, 2021 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpoulopoulos/f4dafa647751cd02e39f7894d51aafab to your computer and use it in GitHub Desktop.
Save dpoulopoulos/f4dafa647751cd02e39f7894d51aafab to your computer and use it in GitHub Desktop.
def run_model(model):
num_images = 64
noise, _ = model.buildNoiseData(num_images)
with torch.no_grad():
generated_images = model.test(noise)
# let's plot these images using torchvision and matplotlib
import matplotlib.pyplot as plt
import torchvision
plt.imshow(torchvision.utils.make_grid(generated_images).permute(1, 2, 0).cpu().numpy())
run_model(model)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment