(self, netG, global_step, num_images=64)
Produce visualisations of the G(z), one fixed and one random.

        Args:
            netG (Module): Generator model object for producing images.
            global_step (int): Global step variable for syncing logs.
            num_images (int): The number of images to visualise.

        Returns:
            None
Produce visualisations of the G(z), one fixed and one random.
Produce visualisations of the G ( z ) one fixed and one random .
def vis_images(self, netG, global_step, num_images=64):
        """
        Produce visualisations of the G(z), one fixed and one random.

        Args:
            netG (Module): Generator model object for producing images.
            global_step (int): Global step variable for syncing logs.
            num_images (int): The number of images to visualise.

        Returns:
            None
        """
        img_dir = os.path.join(self.log_dir, 'images')
        if not os.path.exists(img_dir):
            os.makedirs(img_dir)

        # Generate random images
        fake_images = netG.generate_images(num_images=num_images)

        # Generate fixed random images
        # fixed_noise = self._get_fixed_noise(nz=netG.nz,
        #                                     num_images=num_images)

        # if hasattr(netG, 'num_classes') and netG.num_classes > 0:
        #     fixed_labels = self._get_fixed_labels(num_images,
        #                                           netG.num_classes)
        #     fixed_fake_images = netG(fixed_noise,
        #                              fixed_labels).detach().cpu()
        # else:
        #     fixed_fake_images = netG(fixed_noise).detach().cpu()

        # Map name to results
        images_dict = {
            'fake': fake_images
        }

        # Visualise all results
        for name, images in images_dict.items():
            images_viz = vutils.make_grid(images,
                                          padding=2,
                                          normalize=True)

            vutils.save_image(images_viz,
                              '{}/{}_samples_step_{}.png'.format(
                                    img_dir, name, global_step))
def vis_images ( self , netG , global_step , num_images = 64 ) : img_dir = os . path . join ( self . log_dir , 'images' ) if not os . path . exists ( img_dir ) : os . makedirs ( img_dir ) # Generate random images fake_images = netG . generate_images ( num_images = num_images ) # Generate fixed random images # fixed_noise = self._get_fixed_noise(nz=netG.nz, #                                     num_images=num_images) # if hasattr(netG, 'num_classes') and netG.num_classes > 0: #     fixed_labels = self._get_fixed_labels(num_images, #                                           netG.num_classes) #     fixed_fake_images = netG(fixed_noise, #                              fixed_labels).detach().cpu() # else: #     fixed_fake_images = netG(fixed_noise).detach().cpu() # Map name to results images_dict = { 'fake' : fake_images } # Visualise all results for name , images in images_dict . items ( ) : images_viz = vutils . make_grid ( images , padding = 2 , normalize = True ) vutils . save_image ( images_viz , '{}/{}_samples_step_{}.png' . format ( img_dir , name , global_step ) )