(self, n_samples)
return samples
Generate samples.

        Parameters
        ----------
        n_samples : int
            Number of samples to generate.

        Returns samples.
Generate samples.
Generate samples .
def sample(self, n_samples):
        """Generate samples.

        Parameters
        ----------
        n_samples : int
            Number of samples to generate.

        Returns samples.
        """
        batch_size = min(self.batch_size, n_samples)

        # Generate samples.
        zs = np.empty([n_samples, self.net_arch['n_input']])
        for i in range(self.net_arch['n_input']):
            zs[:, i] = self.random_state.uniform(
                low=0.0, high=1.0, size=n_samples)

        samples = np.zeros((n_samples, self.z.get_shape()[1]))
        for i in range(n_samples // batch_size):
            z_batch = np.reshape(zs[batch_size * i:batch_size * (i+1)],
                                 (batch_size, self.z.get_shape()[1]))
            samples[batch_size * i:batch_size * (i+1)] = self.sess.run(
                self.G, feed_dict={self.z: z_batch})

        return samples
def sample ( self , n_samples ) : batch_size = min ( self . batch_size , n_samples ) # Generate samples. zs = np . empty ( [ n_samples , self . net_arch [ 'n_input' ] ] ) for i in range ( self . net_arch [ 'n_input' ] ) : zs [ : , i ] = self . random_state . uniform ( low = 0.0 , high = 1.0 , size = n_samples ) samples = np . zeros ( ( n_samples , self . z . get_shape ( ) [ 1 ] ) ) for i in range ( n_samples // batch_size ) : z_batch = np . reshape ( zs [ batch_size * i : batch_size * ( i + 1 ) ] , ( batch_size , self . z . get_shape ( ) [ 1 ] ) ) samples [ batch_size * i : batch_size * ( i + 1 ) ] = self . sess . run ( self . G , feed_dict = { self . z : z_batch } ) return samples