Next Article in Journal
Non-Projective Two-Weight Codes
Next Article in Special Issue
PyDTS: A Python Toolkit for Deep Learning Time Series Modelling
Previous Article in Journal
Markov Blankets and Mirror Symmetries—Free Energy Minimization and Mesocortical Anatomy
Previous Article in Special Issue
To Compress or Not to Compress—Self-Supervised Learning and Information Theory: A Review
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Unifying Generator Loss Function for Generative Adversarial Networks

1
Department of Mathematics and Statistics, Queen’s University, Kingston, ON K7L 3N6, Canada
2
Department of Electrical and Computer Engineering, University of California, Los Angeles, CA 90095, USA
*
Author to whom correspondence should be addressed.
Submission received: 23 February 2024 / Revised: 18 March 2024 / Accepted: 22 March 2024 / Published: 27 March 2024

Abstract

:
A unifying α -parametrized generator loss function is introduced for a dual-objective generative adversarial network (GAN) that uses a canonical (or classical) discriminator loss function such as the one in the original GAN (VanillaGAN) system. The generator loss function is based on a symmetric class probability estimation type function, L α , and the resulting GAN system is termed L α -GAN. Under an optimal discriminator, it is shown that the generator’s optimization problem consists of minimizing a Jensen- f α -divergence, a natural generalization of the Jensen-Shannon divergence, where f α is a convex function expressed in terms of the loss function L α . It is also demonstrated that this L α -GAN problem recovers as special cases a number of GAN problems in the literature, including VanillaGAN, least squares GAN (LSGAN), least kth-order GAN (LkGAN), and the recently introduced ( α D , α G ) -GAN with α D = 1 . Finally, experimental results are provided for three datasets—MNIST, CIFAR-10, and Stacked MNIST—to illustrate the performance of various examples of the L α -GAN system.

1. Introduction

Generative adversarial networks (GANs), first introduced by Goodfellow et al. in 2014 [1], have a variety of applications in media generation [2], image restoration [3], and data privacy [4]. GANs aim to generate synthetic data that closely resemble the original real data with (unknown) underlying distribution P x . The GAN is trained such that the distribution of the generated data, P g , approximates P x well. More specifically, low-dimensional random noise is fed to a generator neural network G to produce synthetic data. Real data and the generated data are then given to a discriminator neural network D that scores the data between 0 and 1, with a score close to 1 meaning that the discriminator thinks the data belong to the real dataset. The discriminator and generator play a minimax game, where the aim is to minimize the generator’s loss and maximize the discriminator’s loss.
Since its initial introduction, several variants of GAN have been proposed. Deep convolutional GAN (DCGAN) [5] utilizes the same loss functions as VanillaGAN (the original GAN) while combining GANs with convolutional neural networks, which are helpful when applying GANs to image data as they extract visual features from the data. DCGANs are more stable than the baseline model but can suffer from mode collapse, which occurs when the generator learns that a select number of images can easily fool the discriminator, resulting in the generator only generating those images. Another notable issue with VanillaGAN is the tendency for the generator network’s gradients to vanish. In the early stages of training, the discriminator lacks confidence and assigns generated data values close to zero. Therefore, the objective function tends to zero, resulting in small gradients and a lack of learning. To mitigate this issue, a non-saturating generator loss function was proposed in [1] so that gradients do not vanish early on in training.
In the original (VanillaGAN) problem setup, the objective function, expressed as a negative sum of two Shannon cross-entropies, is to be minimized by the generator and maximized by the discriminator. It is demonstrated that if the discriminator is fixed to be optimal (i.e., as a maximizer of the objective function), the GAN’s minimax game can be reduced to minimizing the Jensen-Shannon divergence (JSD) between the real and generated data’s probability distributions [1]. An analogous result was proven in [6] for RényiGANs, a dual-objective GAN using distinct discriminator and generator loss functions. More specifically, under a canonical discriminator loss function (as in [1]) and a generator loss function expressed in terms of two Rényi cross-entropies, it is shown that the RényiGAN optimization problem reduces to minimizing the Jensen-Rényi divergence, hence extending VanillaGAN’s results.
Nowozin et al. generalized VanillaGAN by formulating a class of loss functions in [7] parametrized by a lower semicontinuous convex function f, devising f-GAN. More specifically, the f-GAN problem consists of minimizing an f-divergence between the true data distribution and the generator distribution via a minimax optimization of a Fenchel conjugate representation of the f-divergence, where the VanillaGAN discriminator’s role (as a binary classifier) is replaced by a variational function estimating the ratio of the true data and generator distributions. The f-GAN loss function may be tedious to derive, as it requires computation of the Fenchel conjugate of f. It can be shown that f-GAN can interpolate between VanillaGAN and HellingerGAN, among others [7].
More recently, α -GAN was presented in [8], for which the aim is to derive a class of loss functions parameterized by α > 0 and expressed in terms of a class probability estimation (CPE) loss between a real label y { 0 , 1 } and predicted label y ^ [ 0 , 1 ] [8]. The ability to control α as a hyperparameter is beneficial to be able to apply one system to multiple datasets, as two datasets may be optimal under different α values. This work was further analyzed in [9] and expanded in [10] by introducing the dual-objective ( α D , α G ) -GAN, which allowed for the generator and discriminator loss functions to have distinct α  parameters with the aim of improving training stability. When α D = α G , the α -GAN optimization reduces to minimizing an Arimoto divergence, as originally derived in [8]. Note that α -GAN can recover several f-GANs, such as HellingerGAN, VanillaGAN, WassersteinGAN, and total variation GAN [8]. Furthermore, in their more recent work [11] that unifies [8,9,10], the authors establish, under some conditions, a one-to-one correspondence between CPE-loss-based GANs (such as α -GANs) and f-GANs that use a symmetric f-divergence (see Theorems 4–5 and Corollary 1 in [11]). They also prove various generalization and estimation error bounds for ( α D , α G ) -GANs and illustrate their ability to mitigate training instability for synthetic Gaussian data as well as the Celeb-A and LSUN Classroom image datasets. The various ( α D , α G ) -GAN equilibrium results do not provide an analogous result to JSD and Jensen-Rényi divergence minimization for the VanillaGAN [1] and RényiGAN [6] problems, respectively, as they do not involve a Jensen-type divergence. More specifically given a divergence measure D ( p q ) between distributions p and q (i.e., a positive-definite bivariate function: D ( p q ) 0 with equality if and only if (iff) p = q almost everywhere (a.e.)), a Jensen-type divergence of D is given by
1 2 D p p + q 2 + 1 2 D q p + q 2 ;
i.e., it is the arithmetic average of two D -divergences: one between p and the mixture ( p + q ) / 2 and the other between q and ( p + q ) / 2 .
The main objective of our work is to present a unifying approach that provides an axiomatic framework to encompass several existing GAN generator loss functions so that GAN optimization can be simplified in terms of a Jensen-type divergence. In particular, our framework classifies the set of α -parameterized CPE-based loss functions L α , generalizing the α -loss function in [8,9,10,11]. We then propose L α -GAN: a dual-objective GAN that uses a function from this class for the generator and uses any canonical discriminator loss function that admits the same optimizer as VanillaGAN [1]. We show that under some regularity (convexity/concavity) conditions on L α , the minimax game played with these two loss functions is equivalent to the minimization of a Jensen- f α -divergence: a Jensen-type divergence and another natural extension of the Jensen-Shannon divergence (in addition to the Jensen-Rényi divergence [6]), where the generating function f α of the divergence is directly computed from the CPE loss function L α . This result recovers various prior dual-objective GAN equilibrium results, thus unifying them under one parameterized generator loss function. The newly obtained Jensen- f α -divergence, which is noted to belong to the class of symmetric f-divergences with different generating functions (see Remark 1), is a useful measure of dissimilarity between distributions as it requires a convex function f with a restricted domain given by the interval [ 0 , 2 ] (see Remark 2) in addition to its symmetry and finiteness properties.
The rest of the paper is organized as follows. In Section 2, we review f-divergence measures and introduce the Jensen-f-divergence as an extension of the Jensen-Shannon divergence. In Section 3, we establish our main result regarding the optimization of our unifying generator loss function (Theorem 1) and show that it can be applied to a large class of known GANs (Lemmas 2–4). We conduct experiments in Section 4 by implementing different manifestations of L α -GAN on three datasets: MNIST, CIFAR-10, and Stacked MNIST. Finally, we conclude the paper in Section 5.

2. Preliminaries

We begin by presenting key information measures used throughout the paper. Let f : [ 0 , ) ( , ] be a convex continuous function that is strictly convex at 1 (i.e., f ( λ u 1 + ( 1 λ ) u 2 ) < λ f ( u 1 ) + ( 1 λ ) f ( u 2 ) for all u 1 , u 2 0 , u 1 u 2 , and λ ( 0 , 1 ) such that λ u 1 + ( 1 λ ) u 2 = 1 ) and satisfying
f ( 1 ) = 0 .
Note that the convexity of f already implies its continuity on ( 0 , ) . Here, the continuity of f at 0 is extended, setting f ( 0 ) = lim u 0 f ( u ) , which may be infinite. Otherwise, f ( u ) is assumed to be finite for  u > 0 .
Definition 1 
([12,13,14]). The f-divergence between two probability densities p and q with common support  R R d  on the Lebesgue measurable space  ( R , B ( R ) , μ )  is denoted by  D f ( p q )  and given by 
D f ( p q ) = R q f p q d μ ,
where we have used the shorthand  R g d μ : = R g ( x ) d μ ( x ) , where g is a measurable function; we follow this convention from now on. Here, f is referred to as the generating function of  D f ( p q ) .
For simplicity, we consider throughout densities with common supports. A comprehensive definition of f-divergence for arbitrary distributions can be found in Section III of [15]. We require that f is strictly convex around 1 and that it satisfies the normalization condition f ( 1 ) = 0 to ensure positive-definiteness of the f-divergence, i.e., D f ( p q ) 0 with equality holding iff p = q (a.e.). We present examples of f-divergences under various choices of their generating function f in Table 1. We will be invoking these divergence measures in different parts of the paper.
The Rényi divergence of order α ( α > 0 , α 1 ) between densities p and q with common support R is used in [6] in the RényiGAN problem; it is given by [23,24]
D α ( p q ) = 1 α 1 log R p α q 1 α d μ .
Note that the Rényi divergence is not an f-divergence; however, it can be expressed as a transformation of the Hellinger divergence (which is itself an f-divergence):
D α ( p q ) = 1 α 1 log ( 1 + ( α 1 ) H α ( p q ) ) .
We now introduce a new measure, the Jensen-f-divergence, which is analogous to the Jensen-Shannon and Jensen-Rényi divergences.
Definition 2. 
The Jensen-f-divergence between two probability distributions p and q with common support R R d on the Lebesgue measurable space ( R , B ( R ) , μ ) is denoted by JD f ( p q ) and given by 
JD f ( p q ) = 1 2 D f p | | p + q 2 + 1 2 D f q | | p + q 2 ,
 where D f ( · · ) is the f-divergence.
We next verify that the Jensen-Shannon divergence is a Jensen-f-divergence.
Lemma 1. 
Let p and q be two densities with common support R R d , and consider the function f : [ 0 , ) ( , ] given by f ( u ) = u log u . Then we have that
JD f ( p q ) = JSD ( p q ) .
Proof. 
As f is convex (and continuous) on its domain with f ( 1 ) = 0 , we have that
JSD ( p q ) = 1 2 KL p | | p + q 2 + 1 2 KL q | | p + q 2 = 1 2 R p log 2 p p + q d μ + 1 2 R q log 2 q p + q d μ = 1 2 R p + q 2 2 p p + q log 2 p p + q d μ + 1 2 R p + q 2 2 q p + q log 2 q p + q d μ = JD f ( p q ) .
Remark 1 
(Jensen-f-divergence is a symmetric f-divergence). Note that JD f ( p q ) is itself a symmetric f-divergence (with a modified generating function). Indeed, given the continuous convex function f that is strictly convex around 1 with f ( 1 ) = 0 , consider the functions
f 1 ( u ) : = u + 1 2 f 2 u u + 1 , u 0 ,
 and
f 2 ( u ) : = u + 1 2 f 2 u + 1 , u 0 ,
which are both continuous convex, strictly convex around 1, and satisfy f 1 ( 1 ) = f 2 ( 1 ) = 0 . Now, direct calculations yield that
D f p | | p + q 2 = D f 1 ( p q )
 and
D f q | | p + q 2 = D f 2 ( p q ) .
Thus,
JD f ( p q ) = 1 2 D f 1 ( p q ) + 1 2 D f 2 ( p q ) = D f ¯ ( p q ) ,
 where f ¯ : = 1 2 ( f 1 + f 2 ) , i.e.,
f ¯ ( u ) = u + 1 4 f 2 u u + 1 + f 2 u + 1 , u 0 ,
is also continuous convex, strictly convex around 1, and satisfies f ¯ ( 1 ) = 0 . Since by (4),
JD f ( p q ) = JD f ( q p ) ,
we conclude that the Jensen-f-divergence is a symmetric f ¯ -divergence. An equivalent argument is to note that f ¯ = f ¯ , where f ¯ ( u ) : = u f ¯ ( 1 u ) , u 0 (with f ¯ ( 0 ) = lim t f ¯ ( t ) / t ), which is a necessary and sufficient condition for the f ¯ -divergence to be symmetric (see p. 4399 in [15]).
Remark 2 
(Domain of f). Examining (4), we note that the Jensen-f-divergence between p and q involves the f-divergences between either p or q and their mixture ( p + q ) / 2 . In other words, to determine JD f ( p q ) , we only need f 2 p p + q and f 2 q p + q when taking the expectations in (1). Thus, it is sufficient to restrict the domain of the convex function f to the interval [ 0 , 2 ] .

3. Main Results

We now present our main theorem that unifies various generator loss functions under a CPE-based loss function L α for a dual-objective GAN, L α -GAN, with a canonical discriminator loss function that is optimized as in [1]. Under some regularity conditions on the loss function L α , we show that under the optimal discriminator, our generator loss becomes a Jensen-f-divergence.
Let ( X , B ( X ) , μ ) be the measured space of n × n × m images (where m = 1 for black and white images and m = 3 for RGB images), and let ( Z , B ( Z ) , μ ) be a measured space such that Z R d . The discriminator neural network is given by D : X [ 0 , 1 ] , and the generator neural network is given by G : Z X . The generator’s noise input is sampled from a multivariate Gaussian distribution P z : Z [ 0 , 1 ] . We denote the probability distribution of the real data by P x : X [ 0 , 1 ] and the probability distribution of the generated data by P g : X [ 0 , 1 ] . We also set P x and P g as the densities corresponding to P x and P g , respectively. We begin by introducing the L α -GAN system.
Definition 3. 
Fix α A R and let L α : { 0 , 1 } × [ 0 , 1 ] [ 0 , ) be a loss function such that y ^ L α 1 , y ^ 2 is a continuous function that is either convex or concave in y ^ [ 0 , 2 ] with strict convexity (respectively, strict concavity) around y ^ = 1 and such that L α is symmetric in the sense that
L α ( 1 , y ^ ) = L α ( 0 , 1 y ^ ) , y ^ [ 0 , 1 ] .
Then the  L α -GAN system is defined by ( V D , V L α , G ) , where V D : X × Z R is the discriminator loss function, and V L α , G : X × Z R is the generator loss function, which is given by
V L α , G ( D , G ) = E A P x [ L α ( 1 , D ( A ) ) ] + E B P g [ L α ( 0 , D ( B ) ) ] .
Moreover, the  L α -GAN problem is defined by
sup D V D ( D , G )
inf G V L α , G ( D , G ) .
We now present our main result about the L α -GAN optimization problem.
Theorem 1. 
For a fixed α A R and L α : { 0 , 1 } × [ 0 , 1 ] [ 0 , ) , let ( V D , V L α , G ) be the loss functions of L α -GAN and consider joint optimization in (9)–(10). If V D is a canonical loss function in the sense that it is maximized at D = D , where
D = P x P x + P g ,
 then (10) reduces to
inf G V L α , G ( D , G ) = inf G 2 a JD f α ( P x P g ) 2 a b ,
where JD f α ( · · ) is the Jensen- f α -divergence, and f α : [ 0 , 2 ] R is a continuous convex function that is strictly convex around 1 and is given by
f α ( u ) = u 1 a L α 1 , u 2 b ,
where a and b are real constants chosen so that f α ( 1 ) = 0 with a < 0 (respectively, a > 0 ) if u L α 1 , u 2 is convex (respectively, concave). Finally, (12) is minimized when P x = P g (a.e.).
Proof. 
Under the assumption that V D is maximized at D = P x P x + P g , we have that
V L α , G ( D , G ) = E A P x [ L α ( 1 , D ( A ) ) ] + E B P g [ L α ( 0 , D ( B ) ) ] = X P x L α ( 1 , D ) d μ X P g L α ( 0 , D ) d μ = X P x L α 1 , P x P x + P g d μ X P g L α 0 , P x P x + P g d μ = 2 X P x + P g 2 P x P x + P g L α 1 , P x P x + P g d μ 2 X P x + P g 2 P g P x + P g L α 0 , P x P x + P g d μ = ( a ) 2 X P x + P g 2 P x P x + P g L α 1 , P x P x + P g d μ 2 X P x + P g 2 P g P x + P g L α 1 , P g P x + P g d μ = ( b ) 2 X P x + P g 2 P x P x + P g a f α 2 P x P x + P g 2 P x P x + P g + a b d μ 2 X P x + P g 2 P g P x + P g a f α 2 P g P x + P g 2 P g P x + P g + a b d μ = 2 a 1 2 X P x + P g 2 f α 2 P x P x + P g d μ + 1 2 X P x + P g 2 f α 2 P g P x + P g d μ 2 a b = 2 a JD f α ( P x P g ) 2 a b ,
where:
  • (a) holds since L α ( 1 , u ) = L α ( 0 , 1 u ) by (7), where u = P x P x + P g .
  • (b) holds by solving for L α ( 1 , u ) in terms of f α ( 2 u ) in (13), where u = P x P x + P g in the first term and u = P g P x + P g in the second term.
The constants a and b are chosen so that f α ( 1 ) = 0 . Finally, the continuity and convexity of f α (as well as its strict convexity around 1) directly follow from the corresponding assumptions imposed on the loss function  L α in Definition 3 and on the condition imposed on the sign of a in the theorem’s statement.    □
Remark 3. 
Note that not only D given in (11) is an optimal discriminator of the (original) VanillaGAN discriminator loss function, but it also optimizes the LSGAN/LkGAN discriminators loss functions when their discriminators’ labels for fake and real data, γ and β, respectively satisfy γ = 1 and β = 0 (see Section 3.3).
We next show that the L α -GAN of Theorem 1 recovers as special cases a number of well-known GAN generator loss functions and their equilibrium points (under an optimal classical discriminator D ).

3.1. VanillaGAN

VanillaGAN [1] uses the same loss function V VG for the both generator and discriminator, which is
V VG ( D , G ) = E A P x [ log D ( A ) ] + E B P g [ log ( 1 D ( B ) ) ]
and can be cast as a saddle point optimization problem:
inf G sup D V V G ( D , G ) .
It is shown in [1] that the optimal discriminator for (15) is given by D = P x P x + P g , as in (11). When D = D , the optimization reduces to minimizing the Jensen-Shannon divergence:
inf G V VG ( D , G ) = inf G 2 JSD ( P x P g ) 2 log 2 .
We next show that (16) can be obtained from Theorem 1.
Lemma 2. 
Consider the optimization of VanillaGAN given in (15). Then we have that 
V VG ( D , G ) = 2 JSD ( P x P g ) 2 log 2 = V L α , G ( D , G ) ,
where  L α ( y , y ^ ) = y log ( y ^ ) ( 1 y ) log ( 1 y ^ )  for all  α A = R .
Proof. 
For any fixed α R , let the function L α in (8) be as defined in the statement:
L α ( y , y ^ ) = y log ( y ^ ) ( 1 y ) log ( 1 y ^ ) .
Note that L α is symmetric, since for y ^ [ 0 , 1 ] , we have that
L α ( 1 , y ^ ) = log ( y ^ ) = L α ( 0 , 1 y ^ ) .
Instead of showing the continuity and convexity/concavity conditions imposed on y ^ L α 1 , y ^ 2 in Definition 3, we implicitly verify them by directly deriving f α from L α using (13) and showing that it is continuous convex and strictly convex around 1. Setting a = 1 and b = log 2 , we have that
f α ( u ) = u 1 a L α 1 , u 2 b = u log u 2 log 2 = u log u .
Clearly, f is convex (actually strictly convex on ( 0 , ) and hence strictly convex around 1) and continuous on its domain (where f ( 0 ) = lim u 0 u log ( u ) = 0 ). It also satisfies f ( 1 ) = 0 . By Lemma 1, we know that under the generating function f ( u ) = u log ( u ) , the Jensen-f divergence reduces to the Jensen-Shannon divergence. Therefore, by Theorem 1, we have that
V L α , G ( D , G ) = 2 a JD f α ( P x P g ) 2 a b = 2 JSD ( P x P g ) 2 log 2 = V VG ( D , G ) ,
which finishes the proof.    □

3.2. α -GAN

The notion of α -GANs is introduced in [8] as a way to unify several existing GANs using a parameterized loss function. We describe α -GANs next.
Definition 4 
([8]). Let y { 0 , 1 } be a binary label, y ^ [ 0 , 1 ] , and fix α > 0 . The α -loss between y and y ^ is the map α : { 0 , 1 } × [ 0 , 1 ] [ 0 , ) given by
α ( y , y ^ ) = { α α 1 1 y y ^ α 1 α + ( 1 y ) ( 1 y ^ ) α 1 α , α ( 0 , 1 ) ( 1 , ) y log y ^ ( 1 y ) log ( 1 y ^ ) , α = 1 .
Definition 5 
([8]). For α > 0 , the α -GAN loss function is given by
V α ( D , G ) = E A P x [ α ( 1 , D ( A ) ) ] + E B P g [ α ( 0 , D ( B ) ) ] .
Joint optimization of the α -GAN problem is given by
inf G sup D V α ( D , G ) .
It is known that α -GAN recovers several well-known GANs by varying the α parameter: notably, VanillaGAN ( α = 1 ) [1] and HellingerGAN ( α = 1 2 ) [7]. Furthermore, as α , V α recovers a translated version of the WassersteinGAN loss function [25]. We now present the solution to the joint optimization problem presented in (19).
Proposition 1 
([8]). Let α > 0 and consider joint optimization of the α-GAN presented in (19). The discriminator D that maximizes the loss function is given by
D = P x α P x α + P g α .
Furthermore, when D = D is fixed, the problem in (19) reduces to minimizing an Arimoto divergence (as defined in Table 1) when α 1 :
inf G V α ( D , G ) = inf G A α ( P x P g ) + α α 1 2 1 α 2
 and a Jensen-Shannon divergence when α = 1 :
inf G V 1 ( D , G ) = inf G JSD ( P x P g ) 2 log 2 ,
 where (21) and (22) achieve their minima iff P x = P g (a.e.).
Recently, α -GAN was generalized in [10] to implement a dual-objective GAN, which we describe next.
Definition 6 
([10]). For α D > 0 and α G > 0 , the ( α D , α G ) -GAN’s optimization is given by
sup D V α D ( D , G )
inf G V α G ( D , G )
where V α D and V α G are defined in (18), with α replaced by α D and α G , respectively.
Proposition 2 
([10]). Consider the joint optimization in (23) and (24). Let parameters α D , α G > 0 satisfy
α D 1 , α G > α D α D + 1 or α D > 1 , α D 2 < α G α D .
The discriminator D that maximizes V α D is given by
D = P x α D P x α D + P g α D .
Furthermore, when D = D is fixed, the minimization of V α G in (24) is equivalent to the following f-divergence minimization:
inf G V α G ( D , G ) = inf G D f α D , α G ( P x P g ) + α α 1 2 1 α 2 ,
 where f α D , α G : [ 0 , ) R is given by
f α D , α G ( u ) = α G α G 1 u α D 1 1 α G + 1 + 1 ( u α D + 1 ) 1 1 α G .
We now apply the ( α D , α G ) -GAN to our main result in Theorem 1 by showing that (12) can recover (27) when α D = 1 (which corresponds to a VanillaGAN discriminator loss function).
Lemma 3.
Consider the ( α D , α G ) -GAN given in Definition 6. Let α D = 1 and α G = α > 1 2 . Then, the solution to (24) presented in Proposition 2 is equivalent to minimizing a Jensen- f α -divergence: specifically, if D is the optimal discriminator given by (26), which is equivalent to (11) when α D = 1 , then V α , G ( D , G ) in (27) satisfies
V α , G ( D , G ) = 2 1 α JD f α ( P x P g ) + α α 1 ( 2 1 α 2 ) = V L α , G ( D , G ) ,
 where L α ( y , y ^ ) = α ( y , y ^ ) , and
f α ( u ) = α α 1 u 2 1 α u , u 0 .
Proof. 
We show that Theorem 1 recovers Proposition 2 by setting L α ( y , y ^ ) = α ( y , y ^ ) . Note that α is symmetric since
α ( 1 , y ^ ) = α α 1 ( 1 y ^ 1 1 α ) = α ( 0 , 1 y ^ ) .
As in the proof of Lemma 2, instead of proving the conditions imposed on y ^ L α 1 , y ^ 2 in Definition 3, we derive f α directly from L α using (13) and show that it is continuous convex and strictly convex around 1. From Lemma 2, we know that when α = 1 , f α ( u ) = u log u (which is strictly convex and continuous). For α ( 0 , 1 ) ( 1 , ) , setting a = 2 1 α 1 and  b = α α 1 2 1 1 α 1 in (13), we have that
f α ( u ) = u 1 a L α 1 , u 2 b = u 2 1 1 α α α 1 1 u 2 1 1 α α α 1 ( 2 1 1 α 1 ) = α α 1 ( u ) [ 2 1 1 α u 1 1 α ( 2 1 1 α 1 ) ] = α α 1 ( u 2 1 α u ) .
Clearly, f α ( 1 ) = 0 . Furthermore for α 1 , we have that
f α ( u ) = ( 2 α 1 ) u 1 α α , u 0 ,
which is positive for α > 1 2 , and f α is convex for α > 1 2 (as well as continuous on its domain and strictly convex around 1). Thus, by Theorem 1, we have that
V L α , G ( D , G ) = 2 a JD f α ( P x P g ) 2 a b = 2 · 2 1 α 1 JD f α ( P x P g ) 2 α α 1 2 1 α 1 ( 2 1 1 α 1 ) = 2 1 α JD f α ( P x P g ) + α α 1 ( 2 1 α 2 ) .
We now show that the above Jensen- f α -divergence is equal to the f 1 , α -divergence originally derived for the ( 1 , α ) -GAN problem of Proposition 2 (note from Proposition 2 that if α D = 1 , then α G = α > 1 2 , so the range of α concurs with the range required above for the convexity of f α ). For any two distributions p and q with common support X , we have that
D f 1 , α ( p q ) = α α 1 X q p q 2 1 α + 1 p q + 1 1 1 α d μ α α 1 2 1 α = α α 1 X q p q 2 1 α + 1 p + q q 1 1 α d μ α α 1 2 1 α = α α 1 X ( p + q ) p p + q 2 1 α + ( p + q ) q p + q 2 1 α d μ α α 1 2 1 α = α α 1 2 2 2 1 α X p + q 2 2 p p + q 2 1 α + p + q 2 2 q p + q 2 1 α d μ α α 1 2 1 α = α α 1 2 1 α 1 X p + q 2 2 p p + q 2 1 α 2 p p + q + p d μ + α α 1 2 1 α 1 X p + q 2 2 q p + q 2 1 α 2 q p + q + q d μ α α 1 2 1 α = α α 1 2 1 α 1 2 X p + q 2 2 p p + q 2 1 α 2 p p + q d μ + 1 + α α 1 2 1 α 1 2 X p + q 2 2 q p + q 2 1 α 2 q p + q d μ + 1 α α 1 2 1 α = 2 1 α JD f α ( p q ) + α α 1 2 1 α 1 ( 2 ) α α 1 2 1 α = 2 1 α JD f α ( p q ) .
Therefore, V L α , G ( D , G ) = V α ( D , G ) .    □
Note that this lemma generalizes Lemma 2; VanillaGAN is a special case of ( 1 , α ) -GAN for α = 1 .

3.3. Shifted LkGANs and LSGANs

Least squares GAN (LSGAN) was proposed in [26] to mitigate the vanishing gradient problem with VanillaGAN and to stabilize training performance. LSGAN’s loss function is derived from the squared error distortion measure, whereby we aim to minimize the distortion between the data samples and a target value we want the discriminator to assign the samples to. LSGAN was generalized with LkGAN in [6] by replacing the squared error distortion measure with an absolute error distortion measure of order k 1 , therefore introducing an additional degree of freedom to the generator’s loss function. We first state the general LkGAN problem. We then apply the result of Theorem 1 to the loss functions of LSGAN and LkGAN.
Definition 7 
([6]). Let γ, β, c [ 0 , 1 ]  , and let k 1 . LkGAN’s loss functions, denoted by  V LSGAN , D  and  V k , G , are given by
V LSGAN , D ( D , G ) = 1 2 E A P x [ ( D ( A ) β ) 2 ] 1 2 E B P g [ ( D ( B ) γ ) 2 ]
V k , G ( D , G ) = E A P x [ | D ( A ) c | k ] + E B P g [ | D ( B ) c | k ] .
The LkGAN problem is the joint optimization
sup D V LSGAN , D ( D , G )
inf G V k , G ( D , G ) .
We next recall the solution to (33), which is a minimization of the Pearson–Vajda divergence | χ | k ( · · ) of order k (as defined in Table 1).
Proposition 3 
([6]). Consider the joint optimization for LkGAN presented in (33). Then the optimal discriminator D that maximizes V LSGAN , D in (31) is given by
D = γ P x + β P g P x + P g .
Furthermore, if D = D and γ β = 2 ( c β ) , the minimization of V k , G in (32) reduces to
inf G V k , G ( D , G ) = inf G | c β | k | χ | k ( P x + P g 2 P g ) .
Note that LSGAN [26] is a special case of LkGAN, as we recover LSGAN when k = 2  [6].
By scrutinizing Proposition 3 and Theorem 1, we observe that the former cannot be recovered from the latter. However, we can use Theorem 1 by slightly modifying the LkGAN generator’s loss function. First, for the dual-objective GAN proposed in Theorem 1, we need D = P x P x + P g . By (35), this is achieved for γ = 1 and β = 0 . Then, we define the intermediate loss function
V ˜ k , G ( D , G ) = E A P x [ | D ( A ) c 1 | k ] + E B P g [ | D ( B ) c 2 | k ] .
Comparing the above loss function with (8), we note that setting c 1 = 0 and c 2 = 1 in (37) satisfies the symmetry property of L α . Finally, to ensure the generating function f α satisfies f α ( 1 ) = 0 , we shift each term in (37) by 1. Putting these changes together, we propose a revised generator loss function denoted by V ^ k , G and given by
V ^ k , G ( D , G ) = E A P x [ | D ( A ) | k 1 ] + E B P g [ | 1 D ( B ) | k 1 ] .
We call a system that uses (38) as a generator loss function a Shifted L k GAN (SL k GAN). If k = 2 , we have a shifted version of the LSGAN generator loss function, which we call Shifted LSGAN (SLSGAN). Note that none of these modifications alter the gradients of V k , G in (32), since the first term is independent of G, the choice of c 1 is irrelevant, and translating a function by a constant does not change its gradients. However, from Proposition 3, for γ = 0 , β = 1 , and c = 1 , we do not have that γ β = 2 ( c β ) , and as a result, this modified problem does not reduce to minimizing a Pearson–Vajda divergence. Consequently, we can relax the condition on k in Definition 7 to just k > 0 . We now show how Theorem 1 can be applied to L α -GAN using (38).
Lemma 4. 
Let k > 0 . Let V D be a discriminator loss function, and let V ^ k , G be the generator’s loss function defined in (38). Consider the joint optimization
sup D V D ( D , G )
inf G V ^ k , G ( D , G )
If V D is optimized at D = P x P x + P g (i.e., V D is canonical), then we have that
V ^ k , G ( D , G ) = 1 2 k 1 JD f k ( P x P g ) + 1 2 k 1 1 2 ,
 where f k is given by
f k ( u ) = u ( u k 1 ) , u 0 .
Examples of V D ( D , G ) that satisfy the requirements of Lemma 4 include the LkGAN discriminator loss function given by (31) with γ = 1 and β = 0 and the VanillaGAN discriminator loss function given by (14).
Proof. 
Let k > 0 . We can restate SLkGAN’s generator loss function in (38) in terms of V L α , G in (8): we have that V L α , G ( D , G ) = V ^ k , G ( D , G ) , where α = k , and L k : { 0 , 1 } × [ 0 , 1 ] [ 0 , ) is given by
L k ( y , y ^ ) = ( y ( y ^ k 1 ) + ( 1 y ) ( ( 1 y ^ ) k 1 ) ) .
We have that L k is symmetric, since
L k ( 1 , y ^ ) = ( y ^ k 1 ) = L k ( 0 , 1 y ^ ) .
We derive f α from L α via (13) and directly check that it is continuous convex and strictly convex around 1. Setting a = 1 2 k and b = 2 k 1 in (13), we have that
f k ( u ) = u 1 a L k 1 , u 2 b = u 2 k 1 u 2 k ( 2 k 1 ) = u ( 2 k u k 2 k + 1 ) = u ( u k 1 ) .
We clearly have that f k ( 1 ) = 0 and that f k is continuous. Furthermore, we have that f k ( u ) = k ( k + 1 ) u , which is non-negative for u 0 . Therefore, f k is convex (as well as strictly convex around 1). As a result, by Theorem 1, we have that
V ^ k , G ( D , G ) = 1 2 k 1 JD f k ( P x P g ) 1 2 k 1 ( 2 k 1 ) = 1 2 k 1 JD f k ( P x P g ) + 1 2 k 1 1 2 .
We conclude this section by emphasizing that Theorem 1 serves as a unifying result recovering the existing loss functions in the literature and, moreover, provides a way for generalizing new ones. Our aim in the next section is to demonstrate the versatility of this result in experimentation.

4. Experiments

We perform two experiments on three different image datasets that we describe below.
Experiment 1: In the first experiment, we compare ( α , α ) -GAN with ( 1 , α ) -GAN while controlling the value of α . Recall that α D = 1 corresponds to the canonical VanillaGAN (or DCGAN) discriminator. We aim to verify whether or not replacing an α -GAN discriminator with a VanillaGAN discriminator stabilizes or improves the system’s performance depending on the value of α . Note that the result of Theorem 1 only applies to the ( α D , α G ) -GAN for α D = 1 . We herein confine the comparison of ( 1 , α ) -GAN with ( α , α ) -GAN only so that both systems have the same tunable free parameter α . The results obtained in [10] for the Stacked MNIST dataset show that ( α D , α G ) -GAN provides consistently robust performance when α D = α G . Other experiments illustrating the performance of ( α D , α G ) -GAN with α D 1 are carried for the Celeb-A and LSUN Classroom image datasets in [11] and show improved training stability for α D < 1 values.
Experiment 2: We train two variants of SLkGAN with the generator loss function as described in (38) and parameterized by k > 0 . We then utilize two different canonical discriminator loss functions to align with Theorem 1. The first is the VanillaGAN discriminator loss given by (14); we call the resulting dual-objective GAN Vanilla-SL k GAN. The second is the LkGAN discriminator loss given by (31), where we set γ = 1 and β = 0 such that the optimal discriminator is given by (11). We call this system L k -SL k GAN. We compare the two variants to analyze how the value of k and choice of discriminator loss impacts the system’s performance.

4.1. Experimental Setup

We run both experiments on three image datasets: MNIST [27], CIFAR-10 [28], and Stacked MNIST [29]. The MNIST dataset is a dataset of black and white handwritten digits between 0 and 9 and with a size of 28 × 28 × 1 . The CIFAR-10 dataset is an RGB dataset of small images of common animals and modes of transportation with a size of 32 × 32 × 3 . The Stacked MNIST dataset is an RGB dataset derived from the MNIST dataset and constructed by taking three MNIST images, assigning each to one of the three color channels, and stacking the images on top of each other. The resulting images are then padded so that each one of them has a size of 32 × 32 × 3 .
For Experiment 1, we use α values of 0.5, 5.0, 10.0, and 20.0. For each value of α , we train ( α , α )-GAN and ( 1 , α ) -GAN. We additionally train DCGAN, which corresponds to ( 1 , 1 ) -GAN. For Experiment 2, we use k values of 0.25, 1.0, 2.0, 7.5, and 15.0. Note that when k = 2 , we recover LSGAN. For the MNIST dataset, we run 10 trials with the random seeds 123, 500, 1600, 199,621, 60,677, 20,435, 15,859, 33,764, 79,878, and 36,123 and train each GAN for 250 epochs. For the RGB datasets (CIFAR-10 and Stacked MNIST), we run five trials with the random seeds 123, 1600, 60,677, 15,859, and 79,878 and train each GAN for 500 epochs. All experiments utilize an Adam optimizer for the stochastic gradient descent algorithm with a learning rate of 2 × 10 4 and parameters β 1 = 0.5 , β 2 = 0.999 , and ϵ = 10 7 [30]. We also experiment with the addition of a gradient penalty (GP); we add a penalty term to the discriminator’s loss function to encourage the discriminator’s gradient to have a unit norm [31].
The MNIST experiments were run on one 6130 2.1 GHz 1xV100 GPU, 8 CPUs, and 16 GB of memory. The CIFAR-10 and Stacked MNIST experiments were run on one Epyc 7443 2.8 GHz GPU, 8 CPUs, and 16 GB of memory. For each experiment, we report the best overall Fréchet inception distance (FID) score [32], the best average FID score amongst all trials and its variance, and the average epoch the best FID score occurs and its variance. The FID score for each epoch was computed over 10,000 images. For each metric, the lowest numerical value corresponds to the model with the best metric (indicated in bold in the tables). We also report how many trials we include in our summary statistics, as it is possible for a trial to collapse and not train for the full number of epochs. The neural network architectures used in our experiments are presented in Appendix A. The training algorithms are presented in Appendix B.

4.2. Experimental Results

We report the FID metrics for Experiment 1 in Table 2, Table 3 and Table 4 and for Experiment 2 in Table 5, Table 6 and Table 7. We report only on those experiments that produced meaningful results. Models that utilize a simplified gradient penalty have the suffix “-GP”. For ( α D , α G ) -GANs, we display the output of the best-performing systems in Figure 1 and plot the trajectories of the FID scores throughout the training epochs in Figure 2. Similarly for SLKGANs, outputs of the best-performing systems and FID scores vs. epochs trajectories are provided in Figure 3 and Figure 4, respectively.

4.3. Discussion

4.3.1. Experiment 1

From Table 2, we note that 37 of the 90 trials collapse before 250 epochs have passed without a gradient penalty. The (5,5)-GAN collapses for all five trials, and hence, it is not displayed in Table 2. This behavior is expected, as ( α , α )-GAN is more sensitive to exploding gradients when α does not tend to 0 or + [8]. The addition of a gradient penalty could mitigate the discriminator’s gradients diverging in the (5,5)-GAN by encouraging gradients to have a unit norm. Using a VanillaGAN discriminator with an α -GAN generator (i.e., (1, α )-GAN) produces better quality images for all tested values of α compared to when both networks utilize an α -GAN loss function. The (1,10)-GAN achieves excellent stability, converging in all 10 trials, and also achieves the lowest average FID score. The (1,5)-GAN achieves the lowest FID score overall, marginally outperforming DCGAN. Note that when the average best FID score is very close to the best FID score, the resulting best FID score variance is quite small (of the order of 10 3 ), indicating little statistical variability over the trials.
Likewise, for the CIFAR-10 and Stacked MNIST datasets, (1, α )-GAN produces lower FID scores than ( α , α ) -GAN (see Table 3 and Table 4). However, both models are more stable with the CIFAR-10 dataset. With the exception of DCGAN, no model converged to its best FID score for all five trials with the Stacked MNIST dataset. Comparing the trials that did converge, both ( α , α ) -GAN and ( 1 , α ) -GAN performed better on the Stacked MNIST dataset than the CIFAR-10 dataset. For CIFAR-10, the (1,10)- and (1,20)-GANs produced the best overall FID score and the best average FID score, respectively. On the other hand, the (1,0.5)-GAN produced the best overall FID score and the best average FID score for the Stacked MNIST dataset. We also observe a tradeoff between speed and performance for the CIFAR-10 and Stacked MNIST datasets: the ( 1 , α ) -GANs arrive at their lowest FID scores later than their respective ( α , α ) -GANs but achieve lower FID scores overall.
Comparing Figure 2c and Figure 2d, we observe that ( α , α ) -GAN-GP provides more stability than ( 1 , α ) -GAN for lower values of α (i.e., α = 0.5 ) , while ( 1 , α ) -GAN-GP exhibits more stability for higher α values ( α = 10 and α = 20 ). Figure 2e,f show that the two α -GANs trained on the Stacked MNIST dataset exhibit unstable behavior earlier into training when α = 0.5 or α = 20 . However, both systems stabilize and converge to their lowest FID scores as training progresses. The (0.5,0.5)-GAN-GP system in particular exhibits wildly erratic behavior for the first 200 epochs then finishes training with a stable trajectory that outperforms DCGAN-GP.
A future direction is to explore how the complexity of an image dataset influences the best choice of α . For example, the Stacked MNIST dataset might be considered to be less complex than CIFAR-10, as images in the Stacked MNIST dataset only contain four unique colors (black, red, green, and blue), while the CIFAR-10 dataset utilizes significantly more colors.

4.3.2. Experiment 2

We see from Table 5 that all Lk-LkGANs and Vanilla-SLkGANs have FID scores comparable to the DCGAN. When k = 15 , Vanilla-SLkGAN and Lk-SLkGAN arrive at their lowest FID scores slightly earlier than DCGAN and other SLkGANs.
The addition of a simplified gradient penalty is necessary for Lk-SLkGAN to achieve overall good performance on the CIFAR-10 dataset (see Table 6). Interestingly, Vanilla-SLkGAN achieves lower FID scores without a gradient penalty for lower k values ( k = 1 , 2 ) and with a gradient penalty for higher k values ( k = 7.5 , 15 ). When k = 0.25 , both SLkGANs collapsed for all five trials without a gradient penalty.
Table 7 shows that Vanilla-SLkGANs achieve better FID scores than their respective Lk-LkGAN counterparts. However, Lk-LkGANs are more stable, as no single trial collapsed, while 10 of the 25 Vanilla-SLkGAN trials collapsed before 500 epochs had passed. While all Vanilla-SLkGANs outperform the DCGAN with a gradient penalty, Lk-SLkGAN-GP only outperforms DCGAN-GP when k = 15 . Except for when k = 7.5 , we observe that the Lk-SLkGAN system takes fewer epochs to arrive at its lowest FID score. Comparing Figure 4e and Figure 4f, we observe that Lk-SLkGANs exhibit more stable FID score trajectories than their respective Vanilla-SLkGANs. This makes sense, as the LkGAN loss function aims to increase the GAN’s stability compared to DCGAN [6].

5. Conclusions

We introduced a parameterized CPE-based generator loss function for a dual-objective GAN termed L α -GAN that, when used in tandem with a canonical discriminator loss function that achieves its optimum in (11), minimizes a Jensen- f α -divergence. We showed that this system can recover VanillaGAN, ( 1 , α ) -GAN, and LkGAN as special cases. We conducted experiments with the three aforementioned L α -GANs on three image datasets. The experiments indicate that ( 1 , α ) -GAN exhibits better performance than ( α , α ) -GAN with α > 1 . They also show that the devised SLkGAN system achieves lower FID scores with a VanillaGAN discriminator compared with an LkGAN discriminator.
Future work consists of unveiling more examples of existing GANs that fall under our result as well as applying L α -GAN to novel, judiciously designed CPE losses L α and evaluating the performance (in terms of both quality and diversity of generated samples) and the computational efficiency of the resulting models. Another interesting and related direction is to study L α -GAN within the context of f-GANs, given that the Jensen-f-divergence is itself an f-divergence (see Remark 1), by systematically analyzing different Jensen-f-divergences and the role they play in improving GAN performance and stability. Other worthwhile directions include incorporating the proposed L α  loss into state-of-the-art GAN models, such as, among others, BigGAN [33], StyleGAN [34], and CycleGAN [35], for high-resolution data generation and image-to-image translation applications and conducting a meticulous analysis of the sensitivity of the models’ performance to different values of the α parameter and providing guidelines on how best to tune α for different types of datasets.

Author Contributions

Conceptualization, investigation and manuscript preparation, all authors; formal analysis, all authors; software development and simulation, J.V. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported in part by the Natural Sciences and Engineering Research Council (NSERC) of Canada.

Data Availability Statement

All codes used in our experiments can be found at this https://github.com/justin-veiner/MASc, accessed on 20 February 2024.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. Neural Network Architectures

We outline the architectures used for the generator and discriminator. For the MNIST dataset, we use the architectures of [6]. For the CIFAR-10 and Stacked MNIST datasets, we base the architectures on [5]. We summarize some aliases for the architectures in Table A1. For all models, we use a batch size of 100 and a noise size of 784 for the generator input.
Table A1. Summary of aliases used to describe neural network architectures.
Table A1. Summary of aliases used to describe neural network architectures.
AliasDefinition
FCFully Connected
UpConv2DDeconvolutional Layer
Conv2DConvolutional Layer
BNBatch Normalization
LeakyReLULeaky Rectified Linear Unit
We omit the bias in the convolutional and deconvolutional layers to decrease the number of parameters being trained, which in turn decreases computation times. We initialize our kernels using a normal distribution with zero mean and variance 0.01. We present the MNIST architectures in Table A2 and Table A3 and the CIFAR-10 and Stacked MNIST architectures in Table A4 and Table A5.
Table A2. Discriminator architecture for the MNIST dataset.
Table A2. Discriminator architecture for the MNIST dataset.
LayerOutput SizeKernelStrideBNActivation
Input 28 × 28 × 1 No
Conv2D 14 × 14 × 64 5 × 5 2NoLeakyReLU (0.3)
Dropout (0.3) No
Conv2D 7 × 7 × 128 5 × 5 2NoLeakyReLU (0.3)
Dropout(0.3) No
FC1 NoSigmoid
Table A3. Generator architecture for the MNIST dataset.
Table A3. Generator architecture for the MNIST dataset.
LayerOutput SizeKernelStrideBNActivation
Input784
FC 7 × 7 × 256
UpConv2D 7 × 7 × 128 5 × 5 1YesLeakyReLU (0.3)
UpConv2D 14 × 14 × 64 5 × 5 2YesLeakyReLU (0.3)
UpConv2D 28 × 28 × 1 5 × 5 2NoTanh
Table A4. Discriminator architecture for the CIFAR-10 and Stacked MNIST datasets.
Table A4. Discriminator architecture for the CIFAR-10 and Stacked MNIST datasets.
LayerOutput SizeKernelStrideBNActivation
Input 32 × 32 × 3
Conv2D 16 × 16 × 128 3 × 3 2NoLeakyReLU (0.2)
Conv2D 8 × 8 × 128 3 × 3 2NoLeakyReLU (0.2)
Conv2D 4 × 4 × 256 3 × 3 2NoLeakyReLU (0.2)
Dropout (0.4) No
FC1 Sigmoid
Table A5. Generator architecture for the CIFAR-10 and Stacked MNIST datasets.
Table A5. Generator architecture for the CIFAR-10 and Stacked MNIST datasets.
LayerOutput SizeKernelStrideBNActivation
Input784
FC 4 × 4 × 256
UpConv2D 8 × 8 × 128 4 × 4 2YesLeakyReLU (0.2)
UpConv2D 16 × 16 × 128 4 × 4 2YesLeakyReLU (0.2)
UpConv2D 32 × 32 × 128 4 × 4 2YesLeakyReLU (0.2)
Conv2D 32 × 32 × 3 3 × 3 1NoTanh

Appendix B. Algorithms

We outline the algorithms used to train our models in Algorithms A1–A3.
Algorithm A1 Overview of ( α D , α G )-GAN training
   Require α D , α G , number of epochs n e , batch size B, learning rate η
   Initialize generator G with parameters θ G , discriminator D with parameters θ D .
   for i = 1 to n e  do
      Sample batch of real data x = { x 1 , , x B } from dataset
      Sample batch of Gaussian noise vectors z = { z 1 , , z B } N ( 0 , I )
      Update the discriminator’s parameters using an Adam optimizer with learning rate η by descending the gradient:
θ D 1 B i = 1 B ( α ( 1 , D ( x i ) ) α ( 0 , D ( G ( z i ) ) ) )

      or update the discriminator’s parameters with a simplified GP:
θ D 1 B i = 1 B ( α ( 1 , D ( x i ) ) α ( 0 , D ( G ( z i ) ) ) )           + 5 i = 1 B | | x log D ( x ) 1 D ( x ) | | 2 2

      Update the generator’s parameters using an Adam optimizer with learning rate η and descending the gradient:
θ G 1 B i = 1 B α ( 0 , D ( G ( z i ) ) )

   end for
Algorithm A2 Overview of Lk-SLkGAN training
   Require k, number of epochs n e , batch size B, learning rate η
   Initialize generator G with parameters θ G , discriminator D with parameters θ D .
   for i = 1 to n e  do
      Sample batch of real data x = { x 1 , , x B } from dataset
      Sample batch of Gaussian noise vectors z = { z 1 , , z B } N ( 0 , I )
      Update the discriminator’s parameters using an Adam optimizer with learning rate η by descending the gradient:
θ D 1 B i = 1 B 1 2 ( D ( x i ) 1 ) 2 + 1 2 ( D ( G ( z i ) ) 2 )

      or update the discriminator’s parameters with a simplified GP:
θ D 1 B i = 1 B 1 2 ( D ( x i ) 1 ) 2 + 1 2 ( D ( G ( z i ) ) 2 )           + 5 i = 1 B | | x log D ( x ) 1 D ( x ) | | 2 2

      Update the generator’s parameters using an Adam optimizer with learning rate η and descending the gradient:
θ G 1 B i = 1 B 1 2 ( | 1 D ( G ( z i ) ) | k 1 )

   end for
Algorithm A3 Overview of Vanilla-SLkGAN training
      Require k, number of epochs n e , batch size B, learning rate η
      Initialize generator G with parameters θ G , discriminator D with parameters θ D .
      for i = 1 to n e  do
      Sample batch of real data x = { x 1 , , x B } from dataset
      Sample batch of noise vectors z = { z 1 , , z B } N ( 0 , I )
      Update the discriminator’s parameters using an Adam optimizer with learning rate η by descending the gradient:
θ D 1 B i = 1 B log ( D ( x i ) ) + log ( 1 D ( G ( z i ) ) )

      or update the discriminator’s parameters with a simplified (GP):
θ D 1 B i = 1 B log ( D ( x i ) ) + log ( 1 D ( G ( z i ) ) )           + 5 i = 1 B | | x log D ( x ) 1 D ( x ) | | 2 2

      Update the generator’s parameters using an Adam optimizer with learning rate η and descending the gradient:
θ G 1 B i = 1 B 1 2 ( | 1 D ( G ( z i ) ) | k 1 )

   end for

References

  1. Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y. Generative adversarial nets. In Proceedings of the Advances in Neural Information Processing Systems, Montreal, QC, Canada, 8–13 December 2014; Ghahramani, Z., Welling, M., Cortes, C., Lawrence, N., Weinberger, K., Eds.; Curran Associates, Inc.: Red Hook, NY, USA, 2014; Volume 27, pp. 2672–2680. [Google Scholar]
  2. Kwon, Y.H.; Park, M.G. Predicting future frames using retrospective cycle GAN. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA, 16–20 June 2019. [Google Scholar]
  3. Pan, X.; Zhan, X.; Dai, B.; Lin, D.; Loy, C.C.; Luo, P. Exploiting deep generative prior for versatile image restoration and manipulation. IEEE Trans. Pattern Anal. Mach. Intell. 2021, 44, 7474–7489. [Google Scholar] [CrossRef] [PubMed]
  4. Jordon, J.; Yoon, J.; Van Der Schaar, M. PATE-GAN: Generating synthetic data with differential privacy guarantees. In Proceedings of the International Conference on Learning Representations, Vancouver, BC, Canada, 30 April–3 May 2018. [Google Scholar]
  5. Radford, A.; Metz, L.; Chintala, S. Unsupervised representation learning with deep convolutional generative adversarial networks. In Proceedings of the 9th International Conference on Image and Graphics, Shanghai, China, 13–15 September 2017; pp. 97–108. [Google Scholar]
  6. Bhatia, H.; Paul, W.; Alajaji, F.; Gharesifard, B.; Burlina, P. Least kth-order and Rényi generative adversarial networks. Neural Comput. 2021, 33, 2473–2510. [Google Scholar] [CrossRef] [PubMed]
  7. Nowozin, S.; Cseke, B.; Tomioka, R. f-GAN: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems; MIT Press: Cambridge, MA, USA, 2016; Volume 29. [Google Scholar]
  8. Kurri, G.R.; Sypherd, T.; Sankar, L. Realizing GANs via a tunable loss function. In Proceedings of the IEEE Information Theory Workshop (ITW), Virtual, 17–21 October 2021; pp. 1–6. [Google Scholar]
  9. Kurri, G.R.; Welfert, M.; Sypherd, T.; Sankar, L. α-GAN: Convergence and estimation guarantees. In Proceedings of the IEEE International Symposium on Information Theory (ISIT), Espoo, Finland, 26 June–1 July 2022; pp. 276–281. [Google Scholar]
  10. Welfert, M.; Otstot, K.; Kurri, G.R.; Sankar, L. (αD,αG)-GANs: Addressing GAN training instabilities via dual objectives. In Proceedings of the IEEE International Symposium on Information Theory (ISIT), Taipei, Taiwan, 25–30 June 2023. [Google Scholar]
  11. Welfert, M.; Kurri, G.R.; Otstot, K.; Sankar, L. Addressing GAN training instabilities via tunable classification losses. arXiv 2023, arXiv:2310.18291. [Google Scholar]
  12. Csiszar, I. Eine Informationstheoretische Ungleichung und ihre Anwendung auf den Bewis der Ergodizitat on Markhoffschen Ketten. Publ. Math. Inst. Hung. Acad. Sci. Ser. A 1963, 8, 85–108. [Google Scholar]
  13. Csiszár, I. Information-type measures of difference of probability distributions and indirect observations. Stud. Sci. Math. Hung. 1967, 2, 299–318. [Google Scholar]
  14. Ali, S.M.; Silvey, S.D. A general class of coefficients of divergence of one distribution from another. J. R. Stat. Soc. Ser. (Methodol.) 1966, 28, 131–142. [Google Scholar] [CrossRef]
  15. Liese, F.; Vajda, I. On divergences and informations in statistics and information theory. IEEE Trans. Inf. Theory 2006, 52, 4394–4412. [Google Scholar] [CrossRef]
  16. Kullback, S.; Leibler, R.A. On information and sufficiency. Ann. Math. Stat. 1951, 22, 79–86. [Google Scholar] [CrossRef]
  17. Nielsen, F. On a generalization of the Jensen–Shannon divergence and the Jensen–Shannon centroid. Entropy 2020, 22, 221. [Google Scholar] [CrossRef] [PubMed]
  18. Nielsen, F.; Nock, R. On the chi square and higher-order chi distances for approximating f-divergences. IEEE Signal Process. Lett. 2013, 21, 10–13. [Google Scholar] [CrossRef]
  19. Arimoto, S. Information-theoretical considerations on estimation problems. Inf. Control. 1971, 19, 181–194. [Google Scholar] [CrossRef]
  20. Österreicher, F. On a class of perimeter-type distances of probability distributions. Kybernetika 1996, 32, 389–393. [Google Scholar]
  21. Hellinger, E. Neue Begründung der Theorie quadratischer Formen von unendlichvielen Veränderlichen. J. Reine Angew. Math. 1909, 1909, 210–271. [Google Scholar] [CrossRef]
  22. Sason, I. On f-divergences: Integral representations, local behavior, and inequalities. Entropy 2018, 20, 383. [Google Scholar] [CrossRef] [PubMed]
  23. Rényi, A. On measures of entropy and information. In Proceedings of the Fourth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1: Contributions to the Theory of Statistics; University of California Press: Berkeley, CA, USA, 1961; Volume 4, pp. 547–562. [Google Scholar]
  24. Van Erven, T.; Harremos, P. Rényi divergence and Kullback-Leibler divergence. IEEE Trans. Inf. Theory 2014, 60, 3797–3820. [Google Scholar] [CrossRef]
  25. Arjovsky, M.; Chintala, S.; Bottou, L. Wasserstein generative adversarial networks. In Proceedings of the International Conference on Machine Learning, PMLR, Sydney, Australia, 6–11 August 2017; pp. 214–223. [Google Scholar]
  26. Mao, X.; Li, Q.; Xie, H.; Lau, R.Y.; Wang, Z.; Paul Smolley, S. Least squares generative adversarial networks. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22–29 October 2017. [Google Scholar]
  27. Deng, L. The MNIST database of handwritten digit images for machine learning research. IEEE Signal Process. Mag. 2012, 29, 141–142. [Google Scholar] [CrossRef]
  28. Krizhevsky, A.; Hinton, G. Learning Multiple Layers of Features from Tiny Images 2009. Available online: https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf (accessed on 22 February 2024).
  29. Lin, Z.; Khetan, A.; Fanti, G.; Oh, S. PacGAN: The power of two samples in generative adversarial networks. In Advances in Neural Information Processing Systems; MIT Press: Cambridge, MA, USA, 2018; Volume 31, pp. 1–10. [Google Scholar]
  30. Kingma, D.; Ba, J. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations, Banff, AB, Canada, 14–16 April 2014. [Google Scholar]
  31. Gulrajani, I.; Ahmed, F.; Arjovsky, M.; Dumoulin, V.; Courville, A.C. Improved training of Wasserstein GANs. In Advances in Neural Information Processing Systems; MIT Press: Cambridge, MA, USA, 2017; Volume 30, pp. 1–11. [Google Scholar]
  32. Heusel, M.; Ramsauer, H.; Unterthiner, T.; Nessler, B.; Hochreiter, S. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. In Advances in Neural Information Processing Systems; MIT Press: Cambridge, MA, USA, 2017; Volume 30, pp. 6626–6637. [Google Scholar]
  33. Brock, A.; Donahue, J.; Simonyan, K. Large scale GAN training for high fidelity natural image synthesis. arXiv 2018, arXiv:1809.11096. [Google Scholar]
  34. Karras, T.; Laine, S.; Aila, T. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 4401–4410. [Google Scholar]
  35. Almahairi, A.; Rajeshwar, S.; Sordoni, A.; Bachman, P.; Courville, A. Augmented CycleGAN: Learning many-to-many mappings from unpaired data. In Proceedings of the International Conference on Machine Learning, PMLR, Stockholm, Sweden, 10–15 July 2018; pp. 195–204. [Google Scholar]
Figure 1. Generated images for the best-performing ( α D , α G )-GANs. (a) ( α D , α G )-GAN for MNIST, α D = 1.0 , α G = 5.0 , FID: 1.125. (b) ( α D , α G ) -GAN-GP for CIFAR-10, α D = 1.0 , α G = 20.0 , FID = 8.466. (c) ( α D , α G ) -GAN-GP for Stacked MNIST, α D = 1.0 , α G = 0.5 , FID = 4.833.
Figure 1. Generated images for the best-performing ( α D , α G )-GANs. (a) ( α D , α G )-GAN for MNIST, α D = 1.0 , α G = 5.0 , FID: 1.125. (b) ( α D , α G ) -GAN-GP for CIFAR-10, α D = 1.0 , α G = 20.0 , FID = 8.466. (c) ( α D , α G ) -GAN-GP for Stacked MNIST, α D = 1.0 , α G = 0.5 , FID = 4.833.
Entropy 26 00290 g001
Figure 2. Average FID scores vs. epochs for various ( α D , α G ) -GANs.
Figure 2. Average FID scores vs. epochs for various ( α D , α G ) -GANs.
Entropy 26 00290 g002
Figure 3. Generated images for best-performing SLkGANs. (a) Vanilla-SLkGAN-0.25 for MNIST, FID = 1.112. (b) Vanilla-SLkGAN-2.0 for CIFAR-10, FID = 4.58. (c) Vanilla-SLkGAN-15.0-GP for Stacked MNIST, FID = 3.836.
Figure 3. Generated images for best-performing SLkGANs. (a) Vanilla-SLkGAN-0.25 for MNIST, FID = 1.112. (b) Vanilla-SLkGAN-2.0 for CIFAR-10, FID = 4.58. (c) Vanilla-SLkGAN-15.0-GP for Stacked MNIST, FID = 3.836.
Entropy 26 00290 g003
Figure 4. FID scores vs. epochs for various SLkGANs.
Figure 4. FID scores vs. epochs for various SLkGANs.
Entropy 26 00290 g004
Table 1. Examples of f-divergences.
Table 1. Examples of f-divergences.
f-DivergenceSymbolFormula f ( u )
Kullback–Leiber [16]KL R p log p q d μ u log u
Jensen-Shannon [17]JSD 1 2 KL p | | p + q 2 + 1 2 KL q | | p + q 2 1 2 u log u ( u + 1 ) log u + 1 2
Pearson χ 2 [18] χ 2 R ( q p ) 2 p d μ x 1 x 2
Pearson–Vajda ( k > 1 ) [18] | χ | k R | q p | k p k 1 d μ u 1 k | 1 u | k
Arimoto ( α > 0 , α 1 ) [15,19,20] A α α α 1 R ( p α + q α ) 1 α d μ 2 1 α α α 1 ( 1 + u ) 1 α ( 1 + u ) 2 1 α + 2
Hellinger ( α > 0 , α 1 ) [15,21,22] H α 1 α 1 R p α q 1 α d μ 1 u α 1 α 1
Table 2. ( α D , α G ) -GAN results for MNIST.
Table 2. ( α D , α G ) -GAN results for MNIST.
( α D , α G )-GANBest FID ScoreAverage Best FID ScoreBest FID Score VarianceAverage EpochsEpoch VarianceNumber of Successful Trials (/10)
(1,0.5)-GAN 1.264 1.288 2.979 × 10 4 227.25 420.25 4
(0.5,0.5)-GAN 1.209 1.265 0.001 234.5 156.7 6
(1,5)-GAN 1.125 1.17 8.195 × 10 4 230.3 617.344 10
(1,10)-GAN 1.147 1.165 7.984 × 10 4 225.6 253.156 10
(10,10)-GAN 36.506 39.361 16.312 1.5 0.5 2
(1,20)-GAN 1.135 1.174 0.001 237.5 274.278 10
(20,20)-GAN 33.23 33.23 0.0 1.0 0.0 1
DCGAN 1.154 1.208 0.001 231.3 357.122 10
Table 3. ( α D , α G ) -GAN results for CIFAR-10.
Table 3. ( α D , α G ) -GAN results for CIFAR-10.
( α D , α G )-GANBest FID ScoreAverage Best FID ScoreBest FID Score VarianceAverage EpochsEpoch VarianceNumber of Successful Trials (/5)
(1,0.5)-GAN-GP 10.551 14.938 12.272 326.2 1808.7 5
(0.5,0.5)-GAN-GP 13.734 14.93 0.517 223.6 11,378.35
(1,5)-GAN-GP 10.772 11.635 0.381 132.0 1233.5 5
(5,5)-GAN-GP 20.79 21.72 0.771 84.8 1527.2 5
(1,10)-GAN-GP 9.465 10.187 0.199 182.6 1096.3 5
(10,10)-GAN-GP 19.99 21.095 0.434 131.8 13,374.75
(1,20)-GAN-GP 8.466 10.217 1.479 216.2 6479.7 5
(20,20)-GAN-GP 19.378 21.216 2.315 138.2 29,824.25
DCGAN-GP 25.731 28.378 3.398 158.0 2510.5 5
Table 4. ( α D , α G ) -GAN results for Stacked MNIST.
Table 4. ( α D , α G ) -GAN results for Stacked MNIST.
( α D , α G )-GANBest FID ScoreAverage Best FID ScoreBest FID Score VarianceAverage EpochsEpoch VarianceNumber of Successful Trials (/5)
(1,0.5)-GAN-GP 4.833 4.997 0.054 311.5 23,112.52
(0.5,0.5)-GAN-GP 6.418 6.418 0.0 479.0 0.0 1
(1,5)-GAN-GP 7.98 7.988 1.357 × 10 4 379.5 11,704.52
(5,5)-GAN-GP 12.236 12.836 0.301 91.5 387.0 4
(1,10)-GAN-GP 7.502 7.528 0.001 326.5 14,280.52
(10,10)-GAN-GP 14.22 14.573 0.249 95.0 450.0 2
(1,20)-GAN-GP 8.379 8.379 0.0 427.0 0.0 1
(20,20)-GAN-GP 16.584 16.584 0.0 94.0 0.0 1
DCGAN-GP 7.507 7.774 0.064 303.4 11,870.85
Table 5. SLkGAN results for MNIST.
Table 5. SLkGAN results for MNIST.
Variant-SLkGAN-kBest FID ScoreAverage Best FID ScoreBest FID Score VarianceAverage EpochsEpoch VarianceNumber of Successful Trials (/10)
Lk-SLkGAN-0.25 1.15 1.174 6.298 × 10 4 224.3 940.9 10
Vanilla-SL k GAN-0.25 1.112 1.162 0.001 237.0 124.0 10
Lk-SLkGAN-1.0 1.122 1.167 8.857 × 10 4 233.0 124.0 10
Vanilla-SLkGAN-1.0 1.126 1.17 9.218 × 10 4 226.2 1182.844 10
Lk-SLkGAN-2.0 1.148 1.198 5.248 × 10 4 237.2 288.4 10
Vanilla-SLkGAN-2.0 1.124 1.184 8.933 × 10 4 237.8 138.4 10
Lk-SLkGAN-7.5 1.455 1.498 4.422 × 10 4 229.0 322.222 10
Vanilla-SLkGAN-7.5 1.439 1.511 0.001 212.2 1995.067 10
Lk-SLkGAN-15.0 1.733 1.872 0.005 198.8 1885.733 10
Vanilla-SLkGAN-15.0 1.773 1.876 0.005 171.6 3122.267 10
DCGAN 1.154 1.208 0.001 231.3 357.122 10
Table 6. SLkGAN results for CIFAR-10.
Table 6. SLkGAN results for CIFAR-10.
Variant-SLkGAN-kBest FID ScoreAverage Best FID ScoreBest FID Score VarianceAverage EpochsEpoch VarianceNumber of Successful Trials (/5)
Lk-SLkGAN-1.0 4.727 118.242 10,914.643 60.8 1897.2 5
Vanilla-SLkGAN-1.0 4.821 5.159 0.092 88.0 506.5 5
Lk-SLkGAN-2.0 4.723 145.565 7492.26 73.2 3904.2 5
Vanilla-SL k GAN-2.0 4.58 5.1 0.261 105.4 740.8 5
Lk-SLkGAN-7.5 6.556 155.497 7116.521 254.6 18,605.35
Vanilla-SLkGAN-7.5 6.384 48.905 8698.195 72.2 1711.7 5
Lk-SLkGAN-15.0 8.576 145.774 5945.097 263.0 36,463.05
Vanilla-SLkGAN-15.0 7.431 50.868 8753.002 82.6 3106.8 5
DCGAN 4.753 5.194 0.117 88.6 462.8 5
Lk-SLkGAN-0.25-GP 17.366 18.974 2.627 87.8 1897.2 5
Vanilla-SLkGAN-0.25-GP 16.013 17.912 1.961 189.0 9487.5 5
Lk-SLkGAN-1.0-GP 10.771 12.567 1.083 77.8 239.2 5
Vanilla-SLkGAN-1.0-GP 8.569 9.588 0.749 197.6 2690.3 5
Lk-SLkGAN-2.0-GP 23.11 25.013 1.924 75.4 658.8 5
Vanilla-SLkGAN-2.0-GP 28.215 29.69 1.242 232.0 20,438.55
Lk-SLkGAN-7.5-GP 33.304 41.48 49.187 82.8 1081.2 5
Vanilla-SLkGAN-7.5-GP 33.085 34.799 1.597 290.8 12,714.75
Lk-SLkGAN-15.0-GP 9.157 12.504 3.839 310.4 6976.8 5
Vanilla-SL k GAN-15.0-GP 7.283 8.568 1.535 185.6 5978.3 5
DCGAN-GP 25.731 28.378 3.398 158.0 2510.5 5
Table 7. SLkGAN results for Stacked MNIST.
Table 7. SLkGAN results for Stacked MNIST.
Variant-SLkGAN-kBest FID ScoreAverage Best FID ScoreBest FID Score VarianceAverage EpochsEpoch VarianceNumber of Successful Trials (/5)
Lk-SLkGAN-0.25-GP 10.541 11.824 0.678 113.6 356.3 5
Vanilla-SLkGAN-0.25-GP 5.197 5.197 0.0 496.0 0.0 1
Lk-SLkGAN-1.0-GP 11.545 12.046 0.291 89.0 238.5 5
Vanilla-SLkGAN-1.0-GP 7.475 7.626 0.045 177.0 3528.0 2
Lk-SLkGAN-2.0-GP 10.682 12.782 2.12 180.2 28,484.75
Vanilla-SLkGAN-2.0-GP 6.023 7.096 0.991 416.667 12,244.3333
Lk-SLkGAN-7.5-GP 8.912 9.906 0.577 239.0 35,663.55
Vanilla-SLkGAN-7.5-GP 6.074 6.43 0.164 238.0 21,729.55
Lk-SLkGAN-15.0-GP 4.458 4.74 0.029 253.4 11,512.35
Vanilla-SL k GAN-15.0-GP 3.836 3.873 0.002 485.0 354.667 4
DCGAN-GP 7.507 7.774 0.064 303.4 11,870.85
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Veiner, J.; Alajaji, F.; Gharesifard, B. A Unifying Generator Loss Function for Generative Adversarial Networks. Entropy 2024, 26, 290. https://0-doi-org.brum.beds.ac.uk/10.3390/e26040290

AMA Style

Veiner J, Alajaji F, Gharesifard B. A Unifying Generator Loss Function for Generative Adversarial Networks. Entropy. 2024; 26(4):290. https://0-doi-org.brum.beds.ac.uk/10.3390/e26040290

Chicago/Turabian Style

Veiner, Justin, Fady Alajaji, and Bahman Gharesifard. 2024. "A Unifying Generator Loss Function for Generative Adversarial Networks" Entropy 26, no. 4: 290. https://0-doi-org.brum.beds.ac.uk/10.3390/e26040290

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop