visualize

Routines for visualizing different aspects of training or its final outputs.

Package Contents

Functions

plot_images_two_rows(top: Iterable[numpy.ndarray], bottom: Iterable[numpy.ndarray], row_size: int = 10, figure_size=(20, 4)) → None

Plot a top-row of images, alongside a bottom-row of images.

plot_reconstruction_on_first_batch(loader: torch.utils.data.DataLoader, model_reconstructing: torch.nn.Module) → None

Plots the first batch of reconstructed images against the original images.

visualize.plot_images_two_rows(top: Iterable[numpy.ndarray], bottom: Iterable[numpy.ndarray], row_size: int = 10, figure_size=(20, 4)) None[source]

Plot a top-row of images, alongside a bottom-row of images.

Parameters
  • top – the images on the top-row. There must be at least :code:row_size: elements.

  • bottom – the images on the bottom-row. There must be at least :code:row_size: elements.

  • row_size – the maximum number of images on a row.

  • figure_size – the size of figure in inches, as passed to plt.figure().

visualize.plot_reconstruction_on_first_batch(loader: torch.utils.data.DataLoader, model_reconstructing: torch.nn.Module) None[source]

Plots the first batch of reconstructed images against the original images.

Parameters
  • loader – a loader from which the first batch of images is loaded.

  • model_reconstructing – a model which reconstructs an image (produces an image of identical structure to the input image, when passed an input-image).