EFFICIENT SAMPLING FOR GENERATIVE ADVERSAR-IAL NETWORKS WITH REPARAMETERIZED MARKOV CHAINS

Abstract

Recently, sampling methods have been successfully applied to enhance the sample quality of Generative Adversarial Networks (GANs). However, in practice, they typically have poor sample efficiency because of the independent proposal sampling from the generator. In this work, we propose REP-GAN, a novel sampling method that allows general dependent proposals by REParameterizing the Markov chains into the latent space of the generator. Theoretically, we show that our reparameterized proposal admits a closed-form Metropolis-Hastings acceptance ratio. Empirically, extensive experiments on synthetic and real datasets demonstrate that our REP-GAN largely improves the sample efficiency and obtains better sample quality simultaneously.

1. INTRODUCTION

Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) have achieved a great success on generating realistic images in recent years (Karras et al., 2019; Brock et al., 2019) . Unlike previous models that explicitly parameterize the data distribution, GANs rely on an alternative optimization between a generator and a discriminator to learn the data distribution implicitly. However, in practice, samples generated by GANs still suffer from problems such as mode collapse and bad artifacts. Recently, sampling methods have shown promising results on enhancing the sample quality of GANs by making use of the information in the discriminator. In the alternative training scheme of GANs, the generator only performs a few updates for the inner loop and has not fully utilized the density ratio information estimated by the discriminator. Thus, after GAN training, the sampling methods propose to further utilize this information to bridge the gap between the generative distribution and the data distribution in a fine-grained manner. For example, DRS (Azadi et al., 2019) applies rejection sampling, and MH-GAN (Turner et al., 2019) adopts Markov chain Monte Carlo (MCMC) sampling for the improved sample quality of GANs. Nevertheless, these methods still suffer a lot from the sample efficiency problem. For example, as will be shown in Section 5, MH-GAN's average acceptance ratio on CIFAR10 can be lower than 5%, which makes the Markov chains slow to mix. As MH-GAN adopts an independent proposal q, i.e., q(x |x) = q(x ), the difference between samples can be so large that the proposal gets rejected easily. To address this limitation, we propose to generalize the independent proposal to a general dependent proposal q(x |x). To the end, the proposed sample can be a refinement of the previous one, which leads to a higher acceptance ratio and better sample quality. We can also balance between the exploration and exploitation of the Markov chains by tuning the step size. However, it is hard to design a proper dependent proposal in the high dimensional sample space X because the energy landscape could be very complex (Neal et al., 2010) . Nevertheless, we notice that the generative distribution p g (x) of GANs is implicitly defined as the push-forward of the latent prior distribution p 0 (z), and designing proposals in the low dimensional latent space is generally much easier. Hence, GAN's latent variable structure motivates us to design a structured dependent proposal with two pairing Markov chains, one in the sample space X and the other in the latent space Z. As shown in Figure 1 , given the current pairing samples (z k , x k ), we draw the next proposal x in a bottom-to-up way: 1) drawing a latent proposal z following q(z |z k ); 2) pushing it forward through the generator and getting the sample proposal x = G(z ); 3)  z k < l a t e x i t s h a 1 _ b a s e 6 4 = " c d l W M J S M M 5 d k a r U j M X h 0 R H + 2 Y V A = " > A A A B 7 H i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B b B U 0 l U 0 G P R i 8 c K p h b a U D b b T b t 0 s w m 7 E 6 G G / g Y v H h T x 6 g / y 5 r 9 x 2 + a g r Q 8 G H u / N M D M v T K U w 6 L r f T m l l d W 1 9 o 7 x Z 2 d r e 2 d 2 r 7 h + 0 T J J p x n 2 W y E S 3 Q 2 q 4 F I r 7 K F D y d q o 5 j U P J H 8 L R z d R / e O T a i E T d 4 z j l Q U w H S k S C U b S S / 9 T L R 5 N e t e b W 3 R n I M v E K U o M C z V 7 1 q 9 t P W B Z z h U x S Y z q e m 2 K Q U 4 2 C S T 6 p d D P D U 8 p G d M A 7 l i o a c x P k s 2 M n 5 M Q q f R I l 2 p Z C M l N / T + Q 0 N m Y c h 7 Y z p j g 0 i 9 5 U / M / r Z B h d B b l Q a Y Z c s f m i K J M E E z L 9 n P S F 5 g z l 2 B L K t L C 3 E j a k m j K 0 + V R s C N 7 i y 8 u k d V b 3 z u v e 3 U W t c V 3 E U Y Y j O I Z T 8 O A S G n A L T f C B g Y B n e I U 3 R z k v z r v z M W 8 t O c X M I f y B 8 / k D L I O O 6 w = = < / l a t e x i t > z k+1 < l a t e x i t s h a 1 _ b a s e 6 4 = " i 2 R T z / 5 N l O q V 6 a w n t 5 e M 9 v i e B T o = " > A A A B 7 n i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B Z B E E q i g h 6 L X j x W s B / Q h r L Z b t q l m 0 3 Y n Q g 1 9 E d 4 8 a C I V 3 + P N / + N 2 z Y H b X 0 w 8 H h v h p l 5 Q S K F Q d f 9 d g o r q 2 v r G 8 X N 0 t b 2 z u 5 e e f + g a e J U M 9 5 g s Y x 1 O 6 C G S 6 F 4 A w V K 3 k 4 0 p 1 E g e S s Y 3 U 7 9 1 i P X R s T q A c c J 9 y M 6 U C I U j K K V W k + 9 b H T m T X r l i l t 1 Z y D L x M t J B X L U e + W v b j 9 m a c Q V M k m N 6 X h u g n 5 G N Q o m + a T U T Q 1 P K B v R A e 9 Y q m j E j Z / N z p 2 Q E 6 v 0 S R h r W w r J T P 0 9 k d H I m H E U 2 M 6 I 4 t A s e l P x P 6 + T Y n j t Z 0 I l K X L F 5 o v C V B K M y f R 3 0 h e a M 5 R j S y j T w t 5 K 2 J B q y t A m V L I h e I s v L 5 P m e d W 7 q H r 3 l 5 X a T R 5 H E Y 7 g G E 7 B g y u o w R 3 U o Q E M R v A M r / D m J M 6 L 8 + 5 8 z F s L T j 5 z C H / g f P 4 A B e G P W w = = < / l a t e x i t > z k+2 < l a t e x i t s h a 1 _ b a s e 6 4 = " i y 4 6 t H M N n O Y 7 d M 6 j d q 0 N c G V c a x Y = " > A A A B 7 n i c b V B N S 8 N A E J 3 4 W e t X 1 a O X x S I I Q k m q o M e i F 4 8 V 7 A e 0 o W y 2 m 3 b p Z h N 2 J 0 I N / R F e P C j i 1 d / j z X / j t s 1 B W x 8 M P N 6 b Y W Z e k E h h 0 H W / n Z X V t f W N z c J W c X t n d 2 + / d H D Y N H G q G W + w W M a 6 H V D D p V C 8 g Q I l b y e a 0 y i Q v B W M b q d + 6 5 F r I 2 L 1 g O O E + x E d K B E K R t F K r a d e N j q v T n q l s l t x Z y D L x M t J G X L U e 6 W v b j 9 m a c Q V M k m N 6 X h u g n 5 G N Q o m + a T Y T Q 1 P K B v R A e 9 Y q m j E j Z / N z p 2 Q U 6 v 0 S R h r W w r J T P 0 9 k d H I m H E U 2 M 6 I 4 t A s e l P x P 6 + T Y n j t Z 0 I l K X L F 5 o v C V B K M y f R 3 0 h e a M 5 R j S y j T w t 5 K 2 J B q y t A m V L Q h e I s v L 5 N m t e J d V L z 7 y 3 L t J o + j A M d w A m f g w R X U 4 A 7 q 0 A A G I 3 i G V 3 h z E u f F e X c Y W Z e k E h h 0 H W / n Z X V t f W N z c J W c X t n d 2 + / d H D Y N H G q G W + w W M a 6 H V D D p V C 8 g Q I l b y e a 0 y i Q v B W M b q d + 6 5 F r I 2 L 1 g O O E + x E d K B E K R t F K r a d e N j q v T n q l s l t x Z y D L x M t J G X L U e 6 W v b j 9 m a c Q V M k m N 6 X h u g n 5 G N Q o m + a T Y T Q 1 P K B v R A e 9 Y q m j E j Z / N z p 2 Q U 6 v 0 S R h r W w r J T P 0 9 k d H I m H E U 2 M 6 I 4 t A s e l P x P 6 + T Y n j t Z 0 I l K X L F 5 o v C V B K M y f R 3 0 h e a M 5 R j S y j T w t 5 K 2 J B q y t A m V L Q h e I s v L 5 P m R c W r V r z 7 y 3 L t J o + j A M d w A m f g w R X U 4 A 7 q 0 A A G I 3 i G V 3 h z E u f F e X c + 5 q 0 r T j 5 z B H / g f P 4 A C O u P X Q = = < / l a t e x i t > ...  n I M v E K U o M C z V 7 1 q 9 t P W B Z z h U x S Y z q e m 2 K Q U 4 2 C S T 6 p d D P D U 8 p G d M A 7 l i o a c x P k s 2 M n 5 M Q q f R I l 2 p Z C M l N / T + Q 0 N m Y c h 7 Y z p j g 0 i 9 5 U / M / r Z B h d B b l Q a Y Z c s f m i K J M E E z L 9 n P S F 5 g z l 2 B L K t L C 3 E j a k m j K 0 + V R s C N 7 i y 8 u k d V b 3 z u v e 3 U W t c V 3 E U Y Y j O I Z T 8 O A S G n A L T f C B g Y B n e I U 3 R z k v z r v z M W 8 t O c X M I f y B 8 / k D K X O O 6 Q = = < / l a t e x i t > x k+1 < l a t e x i t s h a 1 _ b a s e 6 4 = " b j l U S 2 K Q t o X 2 U S + / V s 4 L q I 4 9 i k c = " > A A A B 7 n i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B Z B E E q i g h 6 L X j x W s B / Q h r L Z T t q l m 0 3 Y 3 Y g l 9 E d 4 8 a C I V 3 + P N / + N 2 z Y H b X 0 w 8 H h v h p l 5 Q S K 4 N q 7 7 7 R R W V t f W N 4 q b p a 3 t n x k+2 < l a t e x i t s h a 1 _ b a s e 6 4 = " X w t K k E a F W J j 3 f + s K 9 U T s Q v R C g J I = " > A A A B 7 n i c b V B N S 8 N A E J 3 4 W e t X 1 a O X x S I I Q k m q o M e i F 4 8 V 7 A e 0 o W y 2 m 3 b p Z h N 2 J 2 I J / R F e P C j i 1 d / j z X / j t s 1 B W x 8 M P N 6 b Y W Z e k E h h 0 H W / n Z X V t f W N z c J W c X t n d 2 + / d H D Y N H G q G W + w W M a 6 H V D D p V C 8 g Q I l b y e a 0 y i Q v B W M b q d + 6 5 F r I 2 L 1 g O O E + x E d K B E K R t F K r a d e N j q v T n q l s l t x Z y D L x M t J G X L U e 6 W v b j 9 m a c Q V M k m N 6 X h u g n 5 G N Q o m + a T Y T Q 1 P K B v R A e 9 Y q m j E j Z / N z p 2 Q U 6 v 0 S R h r W w r J T P 0 9 k d H I m H E U 2 M 6 I 4 t A s e l P x P 6 + T Y n j t Z 0 I l K X L F 5 o v C V B K M y f R 3 0 h e a M 5 R j S y j T w t 5 K 2 J B q y t A m V L Q h e I s v L 5 N m t e J d V L z 7 y 3 L t J o + j A M d w A m f g w R X U 4 A 7 q 0 A A G I 3 i G V 3 h z E u f F e X c + 5 q 0 r T j 5 z B H / g f P 4 A B F K P W g = = < / l a t e x i t > assigning x k+1 = x if the proposal x is accepted, otherwise rejected x k+1 = x k . By utilizing the underlying structure of GANs, the proposed reparameterized sampler becomes more efficient in the low-dimensional latent space. We summarize our main contributions as follows: • We propose a structured dependent proposal of GANs, which reparameterizes the samplelevel transition x → x into the latent-level z → z with two pairing Markov chains. We prove that our reparameterized proposal admits a tractable acceptance criterion. • Our proposed method, called REP-GAN, serves as a unified framework for the existing sampling methods of GANs. It provides a better balance between exploration and exploitation by the structured dependent proposal, and also corrects the bias of Markov chains by the acceptance-rejection step. • Empirical results demonstrate that REP-GAN achieves better image quality and much higher sample efficiency than the state-of-the-art methods on both synthetic and real datasets.

2. RELATED WORK

Although GANs are able to synthesize high-quality images, the minimax nature of GANs makes it quite unstable, which usually results in degraded sample quality. A vast literature has been developed to fix the problems of GANs ever since, including novel network modules (Miyato et al., 2018) 



+ 5 q 0 r T j 5 z B H / g f P 4 A B 2 a P X A = = < / l a t e x i t > z k+3 < l a t e x i t s h a 1 _ b a s e 6 4 = " i u I T d S w D d w u s V t 5 v u m N n k s 4 B n u 4 = " > A A A B 7 n i c b V B N S 8 N A E J 3 4 W e t X 1 a O X x S I I Q k m s o M e i F 4 8 V 7 A e 0 o W y 2 m 3 b p Z h N 2 J 0 I N / R F e P C j i 1 d / j z X / j t s 1 B W x 8 M P N 6 b

t e x i t s h a 1 _ b a s e 6 4 = " w x p t uV L k d X B z 2 r j S t U L X 0 B 2 3 9 B M = " > A A A B 7 H i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B b B U 0 l U 0 G P R i 8 c K ph b a U D b b T b t 0 s w m 7 E 7 G E / g Y v H h T x 6 g / y 5 r 9 x 2 + a g r Q 8 G H u / N M D M v T K U w 6 L r f T m l l d W 1 9 o 7 x Z 2 d r e 2 d 2 r 7 h + 0 T J J p x n 2 W y E S 3 Q 2 q 4 F I r 7 K F D y d q o 5 j U P J H 8 L R z d R / e O T a i E T d 4 z j l Q U w H S k S C U b S S / 9 T L R 5 N e t e b W 3 R

d 2 9 8 v 5 B U 8 e p Y t h g s Y h V O 6 A a B Z f Y M N w I b C c K a R Q I b A W j 2 6 n f e k S l e S w f z D h B P 6 I D y U P O q L F S 6 6 m X j c 6 8 S a 9 c c a v u D G S Z e D m p Q I 5 6 r / z V 7 c c s j V A a J q j W H c 9 N j J 9 R Z T g T O C l 1 U 4 0 J Z S M 6 w I 6 l k k a o / W x 2 7 o S c W K V P w l j Z k o b M 1 N 8 T G Y 2 0 H k e B 7 Y y o G e p F b y r + 5 3 V S E 1 7 7 G Z d J a l C y + a I w F c T E Z P o 7 6 X O F z I i x J Z Q p b m 8 l b E g V Z c Y m V L I h e I s v L 5 P m e d W 7 q H r 3 l 5 X a T R 5 H E Y 7 g G E 7 B g y u o w R 3 U o Q E M R v A M r / D m J M 6 L 8 + 5 8 z F s L T j 5 z C H / g f P 4 A A s 2 P W Q = = < / l a t e x i t >

Figure 1: Illustration of REP-GAN's reparameterized dependent proposal with two pairing Markov chains, one in the latent space Z, and the other in the sample space X .

, training mechanism (Metz et al., 2017), and alternative objectives (Arjovsky et al., 2017). Moreover, there is another line of work using sampling methods to improve the sample quality of GANs. DRS (Azadi et al., 2019) firstly proposes to use rejection sampling. MH-GAN (Turner et al., 2019) instead uses the Metropolis-Hasting (MH) algorithm with an independent proposal. DDLS (Che et al., 2020) and DCD (Song et al., 2020) apply gradient-based proposals by viewing GAN as an energy-based model. Tanaka (2019) proposes a similar gradient-based method named DOT from the perspective of optimal transport.

Comparison of sampling methods for GANs in terms of three effective sampling mechanisms.

