Year: 2018

Abstract:
We propose a novel autoencoding model called Pairwise Augmented GANs. We train a generator and an encoder jointly and in an adversarial manner. The generator network learns to sample realistic objects. In turn, the encoder network at the same time is trained to map the true data distribution to the prior in latent space. To ensure good reconstructions, we introduce an augmented adversarial reconstruction loss. Here we train a discriminator to distinguish two types of pairs: an object with its augmentation and the one with its reconstruction. We show that such adversarial loss compares objects based on the content rather than on the exact match. We experimentally demonstrate that our model generates samples and reconstructions of quality competitive with state-of-the-art on datasets MNIST, CIFAR10, CelebA and achieves good quantitative results on CIFAR10.

heading: 1 INTRODUCTION
text: Deep generative models are a powerful tool to sample complex high dimensional objects from a low dimensional manifold. The dominant approaches for learning such generative models are variational autoencoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014) and generative adversarial networks (GANs) (Goodfellow et al., 2014). VAEs allow not only to generate samples from the data distribution, but also to encode the objects into the latent space. However, VAE-like models require a careful likelihood choice. Misspecifying one may lead to undesirable effects in samples and reconstructions (e.g., blurry images). On the contrary, GANs do not rely on an explicit likelihood and utilize more complex loss function provided by a discriminator. As a result, they produce higher quality images. However, the original formulation of GANs (Goodfellow et al., 2014) lacks an important encoding property that allows many practical applications. For example, it is used in semi-supervised learning (Kingma et al., 2014), in a manipulation of object properties using low dimensional manifold (Creswell et al., 2017) and in an optimization utilizing the known structure of embeddings (Gómez-Bombarelli et al., 2018).
VAE-GAN hybrids are of great interest due to their potential ability to learn latent representations like VAEs, while generating high-quality objects like GANs. In such generative models with a bidirectional mapping between the data space and the latent space one of the desired properties is to have good reconstructions (x ≈ G(E(x))). In many hybrid approaches (Rosca et al., 2017; Ulyanov et al., 2018; Zhu et al., 2017; Brock et al., 2017; Tolstikhin et al., 2017) as well as in VAE-like methods it is achieved by minimizing L1 or L2 pixel-wise norm between x and G(E(x)). However, the main drawback of using these standard reconstruction losses is that they enforce the generative model to recover too many unnecessary details of the source object x. For example, to reconstruct a bird picture we do not need an exact position of the bird on an image, but the pixel-wise loss penalizes a lot for shifted reconstructions. Recently, Li et al. (2017) improved ALI model (Dumoulin et al., 2017; Donahue et al., 2017) by introducing a reconstruction loss in the form of a discriminator which classifies pairs (x, x) and (x,G(E(x))). However, in such approach, the discriminator tends to detect the fake pair (x,G(E(x))) just by checking the identity of x and G(E(x)) which leads to vanishing gradients.
In this paper, we propose a novel autoencoding model which matches the distributions in the data space and in the latent space independently as in Zhu et al. (2017). To ensure good reconstructions, we introduce an augmented adversarial reconstruction loss as a discriminator which classifies pairs (x, a(x)) and (x,G(E(x))) where a(·) is a stochastic augmentation function. This enforces the
discriminator to take into account content invariant to the augmentation, thus making training more robust. We call this approach Pairwise Augmented Generative Adversarial Networks (PAGANs). Measuring a reconstruction quality of autoencoding models is challenging. A standard reconstruction metric RMSE does not perform the content-based comparison. To deal with this problem we propose a novel metric Reconstruction Inception Dissimilarity (RID) which is robust to content-preserving transformations (e.g., small shifts of an image). We show qualitative results on common datasets such as MNIST (LeCun & Cortes, 2010), CIFAR10 (Krizhevsky et al., 2009) and CelebA (Liu et al., 2015). PAGANs outperform existing VAE-GAN hybrids in Inception Score (Salimans et al., 2016) and Fréchet Inception Distance (Heusel et al., 2017) except for the recently announced method PD-WGAN (Gemici et al., 2018) on CIFAR10 dataset.

heading: 2 PRELIMINARIES
text: Let us consider an adversarial learning framework where our goal is to match the true distribution p∗(x) to the model distribution pθ(x). As it was proposed in the original paper Goodfellow et al. (2014), the model distribution pθ(x) is induced by the generator Gθ : z −→ x where z is sampled from a prior p(z). To match the distributions p∗(x) and pθ(x) in an adversarial manner, we introduce a discriminator Dψ : x −→ [0, 1]. It takes an object x and predicts the probability that this object is sampled from the true distribution p∗(x). The training procedure of GANs (Goodfellow et al., 2014) is based on the minimax game of two players: the generator Gθ and the discriminator Dψ . This game is defined as follows
min θ max ψ V (θ, ψ) = Ep∗(x) logDψ(x) + Epz(z) log(1−Dψ(Gθ(z))) (1)
where V (θ, ψ) is a value function for this game.
The optimal discriminator Dψ∗ given fixed generator Gθ is
Dψ∗(x) = p∗(x)
p∗(x) + pθ(x) (2)
and then the value function for the generator V (θ, ψ∗) given the optimal discriminator Dψ∗ is equivalent to the Jensen-Shanon divergence between the model distribution pθ(x) and the true distribution p∗(x), i.e.
θ∗ = argmin θ V (θ, ψ∗) = argmin θ JSD(p∗(x)‖pθ(x)). (3)
However, in practice, the gradient of the value function V (θ, ψ) with respect to the generator’s parameters θ vanishes to zero. Therefore, Goodfellow et al. (2014) proposed to train the generator Gθ by minimizing − logDψ(Gθ(z)) instead of log(1 − Dψ(Gθ(z))). This loss for the generator provides much more stable gradients and has the same fixed point as the minimax game of Dψ and Gθ.

heading: 3 PAIRWISE AUGMENTED GENERATIVE ADVERSARIAL NETWORKS
text: In PAGANs model our aim is not only to learn how to generate real objects with the generator Gθ(z) where z is sampled from prior p(z) but at the same time learn an inverse mapping (encoder) Eϕ : x −→ z. Additionally, we use the third stochastic transformation a : x −→ y without parameters which is called augmenter. It produces the augmentation y of the source object x.
Let us consider the distributions which are induced by these three mappings
• pθ(x|z) - the conditional distribution of outputs of the generator Gθ(z) given z; • qϕ(z|x) - the conditional distribution of outputs of the encoder Eϕ(x) given x; • r(y|x) - the conditional distribution over the augmentations a(x) given a source object x.
Within the PAGANs model our goal is to find such optimal parameters θ∗ and ϕ∗ that ensure 1. generator matching: pθ∗(x) = p∗(x) where pθ∗(x) = ∫ pθ∗(x|z)p(z)dz, i.e. the generator
Gθ∗ samples objects from the true distribution p∗(x); 2. encoder matching: qϕ∗(z) = p(z) where qϕ∗(z) = ∫ qϕ∗(z|x)p∗(x)dx, i.e. the encoder
Eϕ generates embeddings z as the prior p(z); 3. reconstruction matching: pθ∗,ϕ∗(y|x) = r(y|x) where
pθ∗,ϕ∗(y|x) = ∫ pθ∗(y|z)qϕ∗(z|x)dz, (4)
i.e. reconstructions Gθ∗(Eϕ∗(x)) are distributed as augmentations r(y|x) of the source object x.

heading: 3.1 GENERATOR & ENCODER MATCHING
text: In order to deal with generator and encoder matching problems we can use the framework of the vanilla GANs (Goodfellow et al., 2014). We introduce two discriminators Dψx and Dψz for two minimax games:
• generator matching: min θ max ψx Vx(θ, ψx) = Ep∗(x) logDψx(x) + Epθ(x) log(1−Dψx(x)) (5)
• encoder matching: min ϕ max ψz Vz(ϕ,ψz) = Ep(z) logDψz (z) + Eqϕ(z) log(1−Dψz (z)) (6)
Then the value functions Vx and Vz given the optimal discriminators Dψ∗x and Dψ∗z are equivalent to Jensen-Shanon divergence:
θ∗ = argmin θ Vx(θ, ψ ∗ x) = argmin θ JSD(p∗(x)‖pθ(x)) (7) ϕ∗ = argmin ϕ Vz(ϕ,ψ ∗ z) = argmin ϕ JSD(p(z)‖qϕ(z)) (8)

heading: 3.2 RECONSTRUCTION MATCHING: AUGMENTED ADVERSARIAL RECONSTRUCTION LOSS
text: The solution of the reconstruction matching problem ensures that reconstructions Gθ(Eϕ(x)) correspond to the source object x up to defined random augmentations a(x). In PAGANs model we introduce the minimax game for training the adversarial distance between the reconstructions and augmentations of the source object x. We consider the discriminator Dψ which takes a pair (x, y) and classifies it into one of the following classes:
• the real class: pairs (x, y) from the distribution p∗(x)r(y|x), i.e. the object x is taken from the true distribution p∗(x) and the second y is obtained from the x by the random augmentation a(x); • the fake class: pairs (x, y) from the distribution
p∗(x)pθ,ϕ(y|x) = p∗(x) ∫ pθ(y|z)qϕ(z|x)dz, (9)
i.e. x is sampled from p∗(x) then z is generated from the conditional distribution qϕ(z|x) by the encoder Eϕ(x) and y is produced by the generator Gϕ(z) from the conditional model distribution pθ(y|z).
Then the minimax problem is
min θ,ϕ max ψ V (θ, ϕ, ψ) (10)
where
V (θ, ϕ, ψ) = Ep∗(x)r(y|x) logDψ(x, y) + Ep∗(x)pθ,ϕ(y|x) log(1−Dψ(x, y)) (11)
Let us prove that such minimax game will match the distributions r(y|x) and pθ,ϕ(y|x). At first, we find the optimal discriminator: Proposition 1. Given a fixed generator Gθ and a fixed encoder Eϕ, the optimal discriminator Dψ∗ is
Dψ∗(x, y) = r(y|x)
r(y|x) + pθ,ϕ(y|x) (12)
Proof. Given in Appendix A.1.
Then we can prove that given an optimal discriminator the value function V (θ, ϕ, ψ) is equivalent to the expected Jensen-Shanon divergence between the distributions r(y|x) and pθ,ϕ(y|x). Proposition 2. The minimization of the value function V under an optimal discriminator Dψ∗ is equivalent to the minimization of the expected Jensen-Shanon divergence between r(y|x) and pθ,ϕ(y|x), i.e.
θ∗, ϕ∗ = argmin θ,ϕ V (θ, ϕ, ψ∗) = argmin θ,ϕ Ep∗(x)JSD(r(y|x)‖pθ,ϕ(y|x)) (13)
Proof. Given in Appendix A.2.
If r(y|x) = δx(y) then the optimal discriminator Dψ∗(x, y) will learn an indicator I{x = y} as was proved in Li et al. (2017). As a consequence, the objectives of the generator and the encoder are very unstable and have vanishing gradients in practice. On the contrary, if the distribution r(y|x) is non-degenerate as in our model then the value function V (θ, ϕ, ψ) will be well-behaved and much more stable which we observed in practice.

heading: 3.3 TRAINING OBJECTIVES
text: We obtain that for the generator and the encoder we should optimize the sum of two value functions:
• the generator’s objective: argmin
θ [Vx(θ, ψx) + V (θ, ϕ, ψ)] = (14)
= argmin θ
[ Epθ(x) log(1−Dψx(x)) + Ep∗(x)pθ,ϕ(y|x) log(1−Dψ(x, y)) ] (15)
• the encoder’s objective: argmin
ϕ [Vz(ϕ,ψz) + V (θ, ϕ, ψ)] = (16)
= argmin ϕ
[ Eqϕ(z) log(1−Dψz (z)) + Ep∗(x)pθ,ϕ(y|x) log(1−Dψ(x, y)) ] (17)
Algorithm 1 The PAGAN training algorithm. θ, ϕ, ψx, ψz, ψxx ← initialize network parameters repeat
x(1), . . . ,x(N) ∼ p∗(x) . Draw N samples from the dataset and the prior z(1), . . . ,z(N) ∼ p(z) ẑ(i) ∼ qϕ(z | x = x(i)), i = 1, . . . , N . Sample from the conditionals x (j) pr ∼ pθ(x | z = z(j)), j = 1, . . . , N x (i) rec ∼ pθ(x | z = ẑ(i)), j = 1, . . . , N x (i) aug ∼ r(y | x = x(i)), j = 1, . . . , N Lxd ← − 1N ∑N i=1 logD(x (i))− 1N ∑N j=1 log ( 1−D(x(j)pr ) ) . Compute discriminator loss
Lzd ← − 1N ∑N i=1 logD(z (i))− 1N ∑N j=1 log ( 1−D(ẑ(j)) ) Lxxd ← − 1N ∑N i=1 logD(x (i),x (i) aug)− 1N ∑N j=1 log ( 1−D(x(j),x(j)rec)
) Lg ← − 1N ∑N i=1 logD(x (i) pr )− 1N ∑N j=1 logD(x (j),x (j) rec) . Compute generator loss
Le ← − 1N ∑N i=1 logD(ẑ (i))− 1N ∑N j=1 logD(x (j),x (j) rec) . Compute encoder loss ψx ← ψx −∇ψxLxd , ψz ← ψz −∇ψzLzd . Gradient update on discriminator networks ψxx ← ψxx −∇ψxxLxxd θ ← θ −∇θLg, ϕ← ϕ−∇ϕLe . Gradient update on generator-encoder networks
until convergence
In practice in order to speed up the training we follow Goodfellow et al. (2014) and use more stable objectives replacing log(1−D(·)) with − log(D(·)). See Figure 1 for the description of our model and Algorithm 1 for an algorithmic illustration of the training procedure.
We can straightforwardly extend the definition of PAGANs model to f -PAGANs which minimize the f -divergence and to WPAGANs which optimize the Wasserstein-1 distance. More detailed analysis of these models is placed in Appendix C.

heading: 4 RELATED WORK
text: Recent papers on VAE-GAN hybrids explore different ways to build a generative model with an encoder part. One direction is to apply adversarial training in the VAE framework to match the variational posterior distribution q(z|x) and the prior distribution p(z) (Mescheder et al., 2017) or to match the marginal q(z) and p(z) (Makhzani et al., 2016; Tolstikhin et al., 2017). Another way within the VAE model is to introduce the discriminator as a part of a data likelihood (Larsen et al., 2015; Brock et al., 2017). Within the GANs framework, a common technique is to regularize the model with the reconstruction loss term (Che et al., 2017; Rosca et al., 2017; Ulyanov et al., 2018).
Another principal approach is to train the generator and the encoder (Donahue et al., 2017; Dumoulin et al., 2017; Li et al., 2017) simultaneously in a fully adversarial way. These methods match the joint distributions p∗(x)q(z|x) and pθ(x|z)p(z) by training the discriminator which classifies the pairs (x, z). ALICE model (Li et al., 2017) introduces an additional entropy loss for dealing with the non-identifiability issues in ALI model. Li et al. (2017) approximated the entropy loss with the cycle-consistency term which is equivalent to the adversarial reconstruction loss. The model of Pu et al. (2017a) puts ALI to the VAE framework where the same joint distributions are matched in an adversarial manner. As an alternative, Ulyanov et al. (2018) train generator and encoder by optimizing the minimax game without the discriminator. Optimal transport approach is also explored, Gemici et al. (2018) introduce an algorithm based on primal and dual formulations of an optimal transport problem.
In PAGANs model the marginal distributions in the data space p∗(x) and pθ(x) and in the latent space p(z) and q(z) are matched independently as in Zhu et al. (2017). Additionally, the augmented adversarial reconstruction loss is minimized by fooling the discriminator which classifies the pairs (x, a(x)) and (x,G(E(x))).

heading: 5 EXPERIMENTS
text: In this section, we validate our model experimentally. At first, we compare PAGAN with other similar methods that allow performing both inference and generation using Inception Score and Fréchet Inception Distance. Secondly, to measure reconstruction quality, we introduce Reconstruction Inception Dissimilarity (RID) and prove its usability. In the last two experiments we show the importance of the adversarial loss and augmentations.
For the architecture choice we used deterministic DCGAN1 generator and discriminator networks provided by pfnet-research2, the encoder network has the same architecture as the discriminator except for the output dimension. The encoder’s output is a factorized normal distribution. Thus pθ(x|z) = δGθ(z)(x), qϕ(z|x) = N (µϕ(x), σ2ϕ(x)I) where µϕ, σϕ are outputs of the encoder network. The discriminator D(z) architecture is chosen to be a 2 layer MLP with 512, 256 hidden units. We also used the same default hyperparameters as provided in the repository and applied a spectral normalization following Miyato et al. (2018). For the augmentation a(x) defined in Section 3 we used a combination of reflecting 10% pad and the random crop to the same image size. The prior distribution p(z) is chosen to be a standard distribution N (0, I). To evaluate Inception Score and Fréchet Inception Distance we used the official implementation provided in tensorflow 1.10.1 (Abadi et al., 2015).
To optimize objectives (16), (14), we need to have a discriminator working on pairs (x, y). This can be done using special network architectures like siam networks (Bromley et al., 1993) or via an image concatenation. The latter approach can be implemented in two concurrent ways: concatenating channel or widthwise. Empirically we found that the siam architecture does not lead to significant improvement and concatenating width wise to be the most stable. We use this configuration in all the experiments.

heading: Sampling Quality
text: To see whether our method provides good quality samples from the prior, we compared our model to related works that allow an inverse mapping. We performed our evaluations on CIFAR10 dataset since quantitative metrics are available there. Considering Fréchet Inception Distance (FID), our model outperforms all other methods. Inception Score shows that PAGANs significantly better than others except for recently announced PD-WGAN. Quantitative results are given in Table 1. For S-VAE we report IS that is reproduced using officially provided code and hyperparameters3. Plots with samples and reconstructions for CIFAR10 dataset are provided in Figure 2. Additional visual results for more datasets can be found in Appendix E.3.
Reconstruction Inception Dissimilarity The traditional approach to estimate the reconstruction quality is to compute RMSE distance from source images to reconstructed ones. However, this metric suffers from focusing on exact reconstruction and is not content aware. RMSE penalizes content-preserving transformations while allows
1DCGAN architecture is a common choice for GANs, other works use similar architecture 2https://github.com/pfnet-research/chainer-gan-lib 3https://github.com/LiqunChen0606/Symmetric-VAE
such undesirable effect as blurriness which degrades visual quality significantly. We propose a novel metric Reconstruction Inception Dissimilarity (RID) which is based on a pre-trained classification network and is defined as follows:
RID = exp {Ex∼DDKL(p(y|x)‖p(y|G(E(x))))} , (18)
where p(y|x) is a pre-trained classifier that estimates the label distribution given an image. Similar to Salimans et al. (2016) we use a pre-trained Inception Network (Szegedy et al., 2016) to calculate softmax outputs.
Low RID indicates that the content did not change after reconstruction. To calculate standard deviations, we use the same approach as for IS and split test set on 10 equal parts4. Moreover RID is robust to augmentations that do not change the visual content and in this sense is much better than RMSE. To compare new metric with RMSE, we train a vanilla VAE with resnet-like architecture on CIFAR10. We compute RID for its reconstructions and real images with the augmentation (mirror 10% pad + random crop). In Table 2 we show that RMSE for VAE is better in comparison to augmented images (AUG), but we are not satisfied with its reconstructions (see Figure 12 in Ap-
pendix E.4), Figure 3 provides even more convincing results. RID allows a fair comparison, for VAE it is dramatically higher (44.33) than for AUG (1.57). Value 1.57 for AUG says that KL divergence is close to zero and thus content is almost not changed. We also provide estimated RID and RMSE for AGE that was publicly available5. From Table 2 we see that PAGANs outperform AGE which reflects that our model has better reconstruction quality.

heading: Importance of adversarial loss
text: To prove the importance of an adversarial loss, we experiment replacing adversarial loss with the
4Split is done sequentially without shuffling 5Pretrained AGE: https://github.com/DmitryUlyanov/AGE
standard L1 pixel-wise distance between source images and corresponding reconstructions and compared FID, IS and RID metrics. Using an augmentation in this setting is ambiguous. Thus we did not use any augmentation in training of the changed model. Quantitative results for the experiment are provided in Table 3. IS and FID results suggest that our model without adversarial loss performed worse in generation. Reconstruction quality significantly dropped considering RID. Visual results in Appendix E.1 confirm our quantitative findings.

heading: Importance of augmentation
text: In ALICE model (Li et al., 2017) an adversarial reconstruction loss was implemented without an augmentation. As we discussed in Section 1 its absence leads to undesirable effects. Here we run an experiment to show that our model without augmentation performs worse. Quantitative results provided in Table 3 illustrate that our model without an augmentation fails to recover both good reconstruction and generation properties. Visual comparisons can be found in Appendix E.2. Using the results obtained from the last two experiments we conclude that adversarial reconstruction loss works significantly better with augmentation.

heading: Choice of Augmentation
text: Experiments checking augmentation effects (see Appendix B for details) conclude the following. A good augmentation: 1) is required to be non-deterministic, 2) should preserve the content of source image, 3) should be hard to use pixel-wise comparison for discriminator.

heading: 6 CONCLUSIONS
text: In this paper, we proposed a novel framework with an augmented adversarial reconstruction loss. We introduced RID to estimate reconstructions quality for images. It was empirically shown that this metric could perform content-based comparison of reconstructed images. Using RID, we proved the value of augmentation in our experiments. We showed that the augmented adversarial loss in this framework plays a key role in getting not only good reconstructions but good generated images.
Some open questions are still left for future work. More complex architectures may be used to achieve better IS and RID. The random shift augmentation may not the only possible choice, and other smart choices are also possible.

heading: APPENDIX A PROOFS

heading: A.1 PROOF OF PROPOSITION 1 (OPTIMAL DISCRIMINATOR)
text: Proposition 1. Given a fixed generator Gθ and a fixed encoder Eϕ, the optimal discriminator Dψ∗ is
Dψ∗(x, y) = r(y|x)
r(y|x) + pθ,ϕ(y|x) (12)
Proof. For fixed generator and encoder, the value function V (ψ) with respect to the discriminator is
V (ψ) = Ep∗(x)r(y|x) logDψ(x, y) + Ep∗(x)pθ,ϕ(y|x) log(1−Dψ(x, y)) (19)
Let us introduce new variables and notations
t = (x, y), p1(t) = p ∗(x)r(y|x), p2(t) = p∗(x)pθ,ϕ(y|x) (20)
Then
V (ψ) = Ep1(t) logDψ(t) + Ep2(t) log(1−Dψ(t)) (21)
Using the results of the paper Goodfellow et al. (2014) we obtain
Dψ∗(t) = p1(t)
p1(t) + p2(t) = p∗(x)r(y|x) p∗(x)r(y|x) + p∗(x)pθ,ϕ(y|x) = r(y|x) r(y|x) + pθ,ϕ(y|x) (22)

heading: A.2 PROOF OF PROPOSITION 2
text: Proposition 2. The minimization of the value function V under an optimal discriminator Dψ∗ is equivalent to the minimization of the expected Jensen-Shanon divergence between r(y|x) and pθ,ϕ(y|x), i.e.
θ∗, ϕ∗ = argmin θ,ϕ V (θ, ϕ, ψ∗) = argmin θ,ϕ Ep∗(x)JSD(r(y|x)‖pθ,ϕ(y|x)) (13)
Proof. As in the paper Goodfellow et al. (2014) we rewrite the value function V (θ, ϕ) for the optimal discriminator Dψ∗ as follows
V (θ, ϕ) = Ep∗(x)r(y|x) logDψ∗(x, y) + Ep∗(x)pθ,ϕ(y|x) log(1−Dψ∗(x, y)) = (23)
= Ep∗(x)r(y|x) log r(y|x)
r(y|x) + pθ,ϕ(y|x) + Ep∗(x)pθ,ϕ(y|x) log pθ,ϕ(y|x) r(y|x) + pθ,ϕ(y|x) = (24)
= Ep∗(x) [ Er(y|x) log
r(y|x) r(y|x) + pθ,ϕ(y|x) + Epθ,ϕ(y|x) log pθ,ϕ(y|x) r(y|x) + pθ,ϕ(y|x)
] = (25)
= Ep∗(x) [− log(4) + 2 · JSD (r(y|x) ‖pθ,ϕ(y|x)) ] (26)

heading: APPENDIX B CHOICE OF AUGMENTATION
text: Augmentation choice might be problem specific. Thereby we additionally study different augmentations and provide an intuition how to choose the right transformation. Theory suggests to pick up a stochastic augmentation. The practical choice should take into account the desired properties of reconstructions. A random shift of an image by a small margin is sufficient to create good quality reconstructions. However, this shift should not be large because it may inherit augmentation artifacts. This can be spotted beforehand just looking at pairs (x, a(x)). Once these pairs are not satisfactory, model reconstructions would be bad as well.

heading: B.1 PADDING SIZE
text: In this experiment, we investigate the effects caused by the padding and random crop augmentation. We choose different padding size (comparatively to the original image size) and plot FID, RID and IS metrics. The results provide the intuition to choose padding size (see Figure 4). Padding should be chosen to maintain visual content while making impossible to compare augmented and original images by nearly element-wise comparison. Larger padding cause undesirable effects in reconstructions that are captured by RID (see Figure 5). Visual quality of samples, on the other hand is slightly better with more aggressive augmentation considering FID metric, what is explained by more robust training due to less mode collapse problem.

heading: B.2 OTHER AUGMENTATIONS
text: We also checked two different augmentation types: Gaussian blur and random contrast (see Figures 6,7). Both augmentations led to highly unstable training and did not yield satisfactory results (IS was 2.15 and 4.18 respectively). Therefore we conclude that a good augmentation is better to change spatial image structure preserving content (as padding does) what will force the discriminator to take content into account.
A good augmentation:
• is required to be non-deterministic • should preserve the content of source image • should be hard to use pixel-wise comparison for discriminator

heading: APPENDIX C EXTENDING PAGANS
text: C.1 f -DIVERGENCE PAGANS
f -GANs (Nowozin et al., 2016) are the generalization of GAN approach. Nowozin et al. (2016) introduces the model which minimizes the f -divergence Df (Ali & Silvey, 1966) between the true distribution p∗(x) and the model distibution pθ(x), i.e. it solves the optimization problem
min θ Df (p
∗(x)‖pθ(x)) = ∫ pθ(x)f ( p∗(x)
pθ(x)
) dx (27)
where f : R+ −→ R is a convex, lower-semicontinuous function satisfying f(1) = 0. The minimax game for f -GANs is defined as
min θ max ψ
V (θ, ψ) = Ep∗(x)Tψ(x)− Epθ(x)f ∗(Tψ(x)) (28)
where V (θ, ψ) is a value function and f∗ is a Fenchel conjugate of f (Nguyen et al., 2008). For fixed parameters θ, the optimal Tψ∗(x) is f ′ ( p∗(x)
pθ(x)
) . Then the value function V (θ, ψ∗) for optimal
parameters ψ∗ equals to f -divergence between the distributions p∗ and pθ (Nguyen et al., 2008), i.e.
V (θ, ψ∗) = Df (p ∗(x)‖pθ(x)) (29)
We can straightforwardly extend the definition of PAGANs model to f -PAGANs. We just introduce for each matching problem the f -GAN value function, i.e.
• generator matching:
min θ max ψ(1)
V (1) f (θ, ψ (1)) = Ep∗(x)Tψ(1)(x)− Epθ(x)f ∗(Tψ(1)(x)) (30)
θ∗ = argmin θ V (1) f (θ, ψ (1) ∗ ) = argmin θ Df (p ∗(x)‖pθ(x)) (31)
• encoder matching:
min ϕ max ψ(2)
V (2) f (ϕ,ψ (2)) = Epz(z)Tψ(2)(z)− Eqϕ(z)f ∗(Tψ(2)(z)) (32)
ϕ∗ = argmin ϕ V (2) f (ϕ,ψ (2) ∗ ) = argmin ϕ Df (pz(z)‖qϕ(z)) (33)
• reconstruction matching: min θ,ϕ max ψ Vf (θ, ϕ, ψ) = Ep∗(x)r(y|x)Tψ(x, y)− Ep∗(x)pθ,ϕ(y|x)f ∗(Tψ(x, y)) (34)
θ∗, ϕ∗ = argmin θ,ϕ V (θ, ϕ, ψ∗) = argmin θ,ϕ Df (r(y|x)‖pθ,ϕ(y|x)) (35)

heading: C.2 WASSERSTEIN PAGANS
text: Arjovsky et al. (2017) proposed WGANs model for minimizing the Wasserstein-1 distance between the distributions p∗(x) and pθ, i.e.
min θ W (p∗(x), pθ(x)) = inf γ∈Π(p∗,pθ) E(x,y)∼γ‖x− y‖ (36)
Because the distance W (p∗(x), pθ(x)) is intractable they consider solving the KantorovichRubinstein dual problem (Villani, 2008)
min θ W (p∗(x), pθ(x)) = min θ max ‖f‖L61
[ Ep∗(x)f(x)− Epθf(x) ] (37)
As in Section C.1 we can easily extend the PAGANs model to WPAGANs. In each matching problem the corresponding distance between distributions will be Wasserstein-1 distance.

heading: APPENDIX D OTHER MODELS AND EXPERIMENT DETAILS

heading: D.1 TRAINING WASSERSTEIN PAGAN
text: As another concurrent approach to match implicit distributions we can use Wasserstein distance. Recent empirical works showed promising results (Gulrajani et al., 2017; Gemici et al., 2018) and thus they are interesting to compare with. As mentioned above we still need a critic to work on pairs of images. Unlike GAN frameworks it is desirable to have a strong critic. A channel wise concatenation for pairs (x, y) worked the best in sense of visual quality and training stability. As a default choice to improve Wasserstein distance optimization we applied the gradient penalty proposed in Gulrajani et al. (2017). To apply the gradient penalty for a critic on pairs we have to interpolate between pairs (x, y) and (x′, y′). There are still two choices:
• shared alpha (x̃, ỹ) = (αx+ (1− α)x′, αy + (1− α)y′), α ∼ U [0, 1] (38)
• independent alpha for each part (x̃, ỹ) = (α1x+ (1− α1)x′, α2y + (1− α2)y′), α1, α2 ∼ U [0, 1] (39)
Empirically we found no differences in results and in further experiments used shared alpha as a default choice. The gradient penalty strength parameter λ was set to 10 as recommended by Gulrajani et al. (2017). We used 10 discriminator steps per 1 generator/encoder step for WPAGAN to slightly improve quality in this setting, other parameters were unchanged. In Table 5 we present results for Wasserstein loss used instead of standard GAN objective in PAGAN model. While having good reconstructions this type of loss failed to achieve good generation results.
Table 5: Inception Score and Fréchet Inception Distance for Wasserstein PAGAN.
Model FID IS RIS WPAGAN 52.29 5.62 ± 0.09 13.44 ± 0.44

heading: APPENDIX E IMAGES

heading: E.1 PAGAN-L1 VISUAL RESULTS
text: (a) CIFAR10 samples from PAGAN-L1 (b) CIFAR10 reconstructions from PAGAN-L1
Figure 8: Evaluation of Generator and Encoder trained on CIFAR10 dataset with adversarial loss replaced with L1 loss. On plot (b) odd columns denote original images, even stand for corresponding reconstructions on test partition
E.2 PAGAN-NOAUG VISUAL RESULTS

heading: E.3 PAGAN VISUAL RESULTS
text: E.4 VAE FOR RECONSTRUCTION INCEPTION SCORE

Review summaries:
The paper propose a adversary method to train a bidirectional GAN with both an encoder and decoder. Comparing to the existing works, the main contribution is the introducing of an augmented reconstruction loss by training a discriminator to distinguish the augmentation data from the reconstructed data. Experimental results are demonstrated to show the generating and reconstruction performance.