(self, real_batch, depth, alpha)
return real_samples
private helper for downsampling the original images in order to facilitate the
        progressive growing of the layers.
        Args:
            real_batch: batch of real samples
            depth: depth at which training is going on
            alpha: current value of the fader alpha

        Returns: modified real batch of samples
private helper for downsampling the original images in order to facilitate the
        progressive growing of the layers.
        Args:
            real_batch: batch of real samples
            depth: depth at which training is going on
            alpha: current value of the fader alpha
private helper for downsampling the original images in order to facilitate the progressive growing of the layers . Args : real_batch : batch of real samples depth : depth at which training is going on alpha : current value of the fader alpha
def progressive_downsample_batch(self, real_batch, depth, alpha):
        """
        private helper for downsampling the original images in order to facilitate the
        progressive growing of the layers.
        Args:
            real_batch: batch of real samples
            depth: depth at which training is going on
            alpha: current value of the fader alpha

        Returns: modified real batch of samples

        """
        # downsample the real_batch for the given depth
        down_sample_factor = int(2 ** (self.depth - depth))
        prior_downsample_factor = int(2 ** (self.depth - depth + 1))

        ds_real_samples = avg_pool2d(
            real_batch, kernel_size=down_sample_factor, stride=down_sample_factor
        )

        if depth > 2:
            prior_ds_real_samples = interpolate(
                avg_pool2d(
                    real_batch,
                    kernel_size=prior_downsample_factor,
                    stride=prior_downsample_factor,
                ),
                scale_factor=2,
            )
        else:
            prior_ds_real_samples = ds_real_samples

        # real samples are a linear combination of
        # ds_real_samples and prior_ds_real_samples
        real_samples = (alpha * ds_real_samples) + ((1 - alpha) * prior_ds_real_samples)

        return real_samples
def progressive_downsample_batch ( self , real_batch , depth , alpha ) : # downsample the real_batch for the given depth down_sample_factor = int ( 2 ** ( self . depth - depth ) ) prior_downsample_factor = int ( 2 ** ( self . depth - depth + 1 ) ) ds_real_samples = avg_pool2d ( real_batch , kernel_size = down_sample_factor , stride = down_sample_factor ) if depth > 2 : prior_ds_real_samples = interpolate ( avg_pool2d ( real_batch , kernel_size = prior_downsample_factor , stride = prior_downsample_factor , ) , scale_factor = 2 , ) else : prior_ds_real_samples = ds_real_samples # real samples are a linear combination of # ds_real_samples and prior_ds_real_samples real_samples = ( alpha * ds_real_samples ) + ( ( 1 - alpha ) * prior_ds_real_samples ) return real_samples