Year: 2020

Abstract:
Generative adversarial networks have been very successful in generative modeling, however they remain relatively challenging to train compared to standard deep neural networks. In this paper, we propose new visualization techniques for the optimization landscapes of GANs that enable us to study the game vector field resulting from the concatenation of the gradient of both players. Using these visualization techniques we try to bridge the gap between theory and practice by showing empirically that the training of GANs exhibits significant rotations around Local Stable Stationary Points (LSSP), similar to the one predicted by theory on toy examples. Moreover, we provide empirical evidence that GAN training converge to a stable stationary point which is a saddle point for the generator loss, not a minimum, while still achieving excellent performance.1

heading: 1 INTRODUCTION
text: Deep neural networks have exhibited remarkable success in many applications (Krizhevsky et al., 2012). This success has motivated many studies of their non-convex loss landscape (Choromanska et al., 2015; Kawaguchi, 2016; Li et al., 2018b), which, in turn, has led to many improvements, such as better initialization and optimization methods (Glorot and Bengio, 2010; Kingma and Ba, 2015).
While most of the work on studying non-convex loss landscapes has focused on single objective minimization, some recent class of models require the joint minimization of several objectives, making their optimization landscape intrinsically different. Among these models is the generative adversarial network (GAN) (Goodfellow et al., 2014) which is based on a two-player game formulation and has achieved state-of-the-art performance on some generative modeling tasks such as image generation (Brock et al., 2019).
On the theoretical side, many papers studying multi-player games have argued that one main optimization issue that arises in this case is the rotation due to the adversarial component of the game (Mescheder et al., 2018; Balduzzi et al., 2018; Gidel et al., 2019b). This has been extensively studied on toy examples, in particular on the so-called bilinear example (Goodfellow, 2016) (a.k.a Dirac GAN (Mescheder et al., 2018)). However, those toy examples are very far from the standard realistic setting of image generation involving deep networks and challenging datasets. To our knowledge it remains an open question if this rotation phenomenon actually occurs when training GANs in more practical settings.
In this paper, we aim at closing this gap between theory and practice. Following Mescheder et al. (2017) and Balduzzi et al. (2018), we argue that instead of studying the loss surface, we should study the game vector field (i.e., the concatenation of each player’s gradient), which can provide
∗Equal contributions. Correspondence to firstname.lastname@umontreal.ca. †Canada CIFAR AI Chair (held at Mila) 1Code available at https://bit.ly/2kwTu87
better insights to the problem. To this end, we propose a new visualization technique that we call Path-angle which helps us observe the nature of the game vector field close to a stationary point for high dimensional models, and carry on an empirical investigation of the properties of the optimization landscape of GANs. The core questions we want to address may be summarized as the following:

heading: Is rotation a phenomenon that occurs when training GANs on real world datasets, and do existing training methods find local Nash equilibria?
text: To answer this question we conducted extensive experiments by training different GAN formulations (NSGAN and WGAN-GP) with different optimizers (Adam and ExtraAdam) on three datasets (MoG, MNIST and CIFAR10). Based on our experiments and using our visualization techniques we observe that the landscape of GANs is fundamentally different from the standard loss surfaces of deep networks. Furthermore, we provide evidence that existing GAN training methods do not converge to a local Nash equilibrium.
Contributions More precisely, our contributions are the following: (i) We propose studying empirically the game vector field (as opposed to studying the loss surfaces of each player) to understand training dynamics in GANs using a novel visualization tool, which we call Path-angle and that captures the rotational and attractive behaviors near local stationary points (ref. §4.2). (ii) We observe experimentally on both a mixture of Gaussians, MNIST and CIFAR10 datasets that a variety of GAN formulations have a significant rotational behavior around their locally stable stationary points (ref. §5.1). (iii) We provide empirical evidence that existing training procedures find stable stationary points that are saddle points, not minima, for the loss function of the generator (ref. § 5.2).

heading: 2 RELATED WORK
text: Improving the training of GANs has been an active research area in the past few years. Most efforts in stabilizing GAN training have focused on formulating new objectives (Arjovsky et al., 2017), or adding regularization terms (Gulrajani et al., 2017; Mescheder et al., 2017; 2018). In this work, we try to characterize the difference in the landscapes induced by different GAN formulations and how it relates to improving the training of GANs.
Recently, Nagarajan and Kolter (2017); Mescheder et al. (2018) show that a local analysis of the eigenvalues of the Jacobian of the game can provide guarantees on local stability properties. However, their theoretical analysis is based on some unrealistic assumptions such as the generator’s ability to fully capture the real distribution. In this work, we assess experimentally to what extent these theoretical stability results apply in practice.
Rotations in differentiable games has been mentioned and interpreted by (Mescheder et al., 2018; Balduzzi et al., 2018) and Gidel et al. (2019b). While these papers address rotations in games from a theoretical perspective, it was never shown that GANs, which are games with highly non-convex losses, suffered from these rotations in practice. To our knowledge, trying to quantify that GANs actually suffer from this rotational component in practice for real world dataset is novel.
The stable points of the gradient dynamics in general games have been studied independently by Mazumdar and Ratliff (2018) and Adolphs et al. (2018). They notice that the locally stable stationary point of some games are not local Nash equilibria. In order to reach a local Nash equilibrium, Adolphs et al. (2018); Mazumdar et al. (2019) develop techniques based on second order information. In this work, we argue that reaching local Nash equilibria may not be as important as one may expect and that we do achieve good performance at a locally stable stationary point.
Several works have studied the loss landscape of deep neural networks. Goodfellow et al. (2015) proposed to look at the linear path between two points in parameter space and show that neural networks behave similarly to a convex loss function along this path. Draxler et al. (2018) proposed an extension where they look at nonlinear paths between two points and show that local minima are connected in deep neural networks. Another extension was proposed by (Li et al., 2018a) where they use contour plots to look at the 2D loss surface defined by two directions chosen appropriately. In this paper, we use a similar approach of following the linear path between two points to gain insight about GAN optimization landscapes. However, in this context, looking at the loss of both players along that path may be uninformative. We propose instead to look, along a linear path from initialization to best solution, at the game vector field, particularly at its angle w.r.t. the linear path, the Path-angle.
Another way to gain insight into the landscape of deep neural networks is by looking at the Hessian of the loss; this was done in the context of single objective minimization by (Dauphin et al., 2014; Sagun et al., 2016; 2017; Alain et al., 2019). Compared to linear path visualizations which can give global information (but only along one direction), the Hessian provides information about the loss landscape in several directions but only locally. The full Hessian is expensive to compute and one often has to resort to approximations such has computing only the top-k eigenvalues. While, the Hessian is symmetric and thus has real eigenvalues, the Jacobian of a game vector field is significantly different since it is in general not symmetric, which means that the eigenvalues belong to the complex plane. In the context of GANs, Mescheder et al. (2017) introduced a gradient penalty and use the eigenvalues of the Jacobian of the game vector field to show its benefits in terms of stability. In our work, we compute these eigenvalues to assess that, on different GAN formulations and datasets, existing training procedures find a locally stable stationary point that is a saddle point for the loss function of the generator.

heading: 3 FORMULATIONS FOR GAN OPTIMIZATION AND THEIR PRACTICAL IMPLICATIONS

heading: 3.1 THE STANDARD GAME THEORY FORMULATION
text: From a game theory point of view, GAN training may be seen as a game between two players: the discriminator Dϕ and the generator Gθ, each of which is trying to minimize its loss LD and LG, respectively. Using the same formulation as Mescheder et al. (2017), the GAN objective takes the following form (for simplicity of presentation, we focus on the unconstrained formulation):
θ∗ ∈ arg min θ∈Rp LG(θ,ϕ∗) and ϕ∗ ∈ arg min ϕ∈Rd LD(θ∗,ϕ) . (1)
The solution (θ∗,ϕ∗) is called a Nash equilibrium (NE). In practice, the considered objectives are non-convex and we typically cannot expect better than a local Nash equilibrium (LNE), i.e. a point at which (1) is only locally true (see e.g. (Adolphs et al., 2018) for a formal definition). Ratliff et al. (2016) derived some derivative-based necessary and sufficient conditions for being a LNE. They show that, for being a local NE it is sufficient to be a differential Nash equilibrium:
Definition 1 (Differential NE). A point (θ∗,ϕ∗) is a differential Nash equilibrium (DNE) iff
‖∇θLG(θ∗,ϕ∗)‖ = ‖∇ϕLD(θ∗,ϕ∗)‖ = 0 , ∇2θLG(θ∗,ϕ∗) 0 and ∇2ϕLD(θ∗,ϕ∗) 0 (2) where S 0 if and only if S is positive definite.
Being a DNE is not necessary for being a LNE because a local Nash equilibrium may have Hessians that are only semi-definite. NE are commonly used in GANs to describe the goal of the learning procedure (Goodfellow et al., 2014): in this definition, θ∗ (resp. ϕ∗) is seen as a local minimizer of LG(·,ϕ∗) (resp. LD(θ∗, ·)). Under this view, however, the interaction between the two networks is not taken into account. This is an important aspect of the game stability that is missed in the definition of DNE (and Nash equilibrum in general). We illustrate this point in the following section, where we develop an example of a game for which gradient methods converge to a point which is a saddle point for the generator’s loss and thus not a DNE for the game.

heading: 3.2 AN ALTERNATIVE FORMULATION BASED ON THE GAME VECTOR FIELD
text: In practice, GANs are trained using first order methods that compute the gradients of the losses of each player. Following Gidel et al. (2019a), an alternative point of view on optimizing GANs is to jointly consider the players’ parameters θ and ϕ as a joint state ω := (θ,ϕ), and to study the vector field associated with these gradients,2 which we call the game vector field
v(ω) := [ ∇θLG(ω)> ∇ϕLD(ω)> ]> where ω := (θ,ϕ) . (3)
2Note that, in practice, the joint vector field (3) is not a gradient vector field, i.e., it cannot be rewritten as the gradient of a single function.
With this perspective, the notion of DNE is replaced by the notion of locally stable stationary point (LSSP). Verhulst (1989, Theorem 7.1) defines a LSSP ω∗ using the eigenvalues of the Jacobian of the game vector field∇v(ω∗) at that point. Definition 2 (LSSP). A point ω∗ is a locally stable stationary point (LSSP) iff
v(ω∗) = 0 and <(λ) > 0 , ∀λ ∈ Sp(∇v(ω∗)) . (4) where < denote the real part of the eigenvalue λ belonging to the spectrum of∇v(ω∗).
This definition is not easy to interpret but one can intuitively understand a LSSP as a stationary point (a point ω∗ where v(ω∗) = 0) to which all neighbouring points are attracted. We will formalize this intuition of attraction in Proposition 1. In our two-player game setting, the Jacobian of the game vector field around the LSSP has the following block-matrices form:
∇v(ω∗) = [ ∇2θLG(ω∗) ∇ϕ∇θLG(ω∗) ∇θ∇ϕLD(ω∗) ∇2ϕLD(ω∗) ] = [ S1 B A S2 ] . (5)
WhenB = −A>, being a DNE is a sufficient condition for being of LSSP (Mazumdar and Ratliff, 2018). However, some LSSP may not be DNE (Adolphs et al., 2018), meaning that the optimal generator θ∗ could be a saddle point of LG(·,ϕ∗), while the optimal joint state (θ∗,ϕ∗) may be a LSSP of the game. We summarize these properties in Table 1. In order to illustrate the intuition behind this counter-intuitive fact, we study a simple example where the generator is 2D and the discriminator is 1D. Example 1. Let us consider LG as a hyperbolic paraboloid (a.k.a., saddle point function) centered in (1, 1) where (1, ϕ) is the principal descent direction and (−ϕ, 1) is the principal ascent direction, while LD is a simple bilinear objective. LG(θ1, θ2, ϕ) = (θ2 − ϕθ1 − 1)2 − 12 (θ1 + ϕθ2 − 1)2 , LD(θ1, θ2, ϕ) = ϕ(5θ1 + 4θ2 − 9)
We plot LG in Fig. 1b. Note that the discriminator ϕ controls the principal descent direction of LG.
We show (see § A.2) that (θ∗1 , θ∗2 , ϕ∗) = (1, 1, 0) is a locally stable stationary point but is not a DNE: the generator loss at the optimum (θ1, θ2) 7→ LG(θ1, θ2, ϕ∗) = θ22 − 12θ21 is not at a DNE because it has a clear descent direction, (1, 0). However, if the generator follows this descent direction, the dynamics will remain stable because the discriminator will update its parameter, rotating the saddle and making (1, 0) an ascent direction. We call this phenomenon dynamic stability: the loss LG(·, ϕ∗) is unstable for a fixed ϕ∗ but becomes stable when ϕ dynamically interacts with the generator around ϕ∗.
A mechanical analogy for this dynamic stability phenomenon is a ball in a rotating saddle—even though the gravity pushes the ball to escape the saddle, a quick enough rotation of the saddle would trap the ball at the center (see (Thompson et al., 2002) for more details). This analogy has been used to explain Paul’s trap (Paul, 1990): a counter-intuitive way to trap ions using a dynamic electric field. In Example 1, the parameter ϕ explicitly controls the rotation of the saddle.
This example illustrates the fact that the DNE corresponds to a notion of static stability: it is the stability of one player’s loss given the other player is fixed. Conversely, LSSP captures a notion of dynamic stability that considers both players jointly.
By looking at the game vector field we capture these interactions. Fig. 1b only captures a snapshot of the generator’s loss surface for a fixed ϕ and indicates static instability (the generator is at a saddle point of its loss). In Fig. 1a, however, one can see that, starting from any point, we will rotate around the stationary point (ϕ∗, θ∗1) = (0, 1) and eventually converge to it.
The visualization of the game vector field reveals an interesting behavior that does not occur in single objective minimization: close to a LSSP, the parameters rotate around it. Understanding this phenomenon is key to grasp the optimization difficulties arising in games. In the next section, we
formally characterize the notion of rotation around a LSSP and in §4 we develop tools to visualize it in high dimensions. Note that gradient methods may converge to saddle points in single objective minimization, but these are not stable stationary points, unlike in our game example.

heading: 3.3 ROTATION AND ATTRACTION AROUND LOCALLY STABLE STATIONARY POINTS IN GAMES
text: In this section, we formalize the notions of rotation and attraction around LSSP in games, which we believe may explain some difficulties in GAN training. The local stability of a LSSP is characterized by the eigenvalues of the Jacobian∇v(ω∗) because we can linearize v(ω) around ω∗:
v(ω) ≈ ∇v(ω∗)(ω − ω∗). (6) If we assume that (6) is an equality, we have the following theorem.
Proposition 1. Let us assume that (6) is an equality and that∇v(ω∗) is diagonalizable, then there exists a basis P such that the coordinates ω̃j(t) := [P (ω(t)−ω∗)]j where ω(t) is a solution of (6) have the following behavior: for λj ∈ Sp∇v(ω∗) we have,
1. If λj ∈ R, we observe pure attraction: ω̃j(t) = e−λjtω̃j(0) .
2. If <(λj) = 0, we observe pure rotation: [ ω̃j(t) ω̃j+1(t) ] = [ cos |λjt| sin |λjt| − sin |λjt| cos |λjt| ] [ ω̃j(0) ω̃j+1(0) ] .
3. Otherwise, we observe both: [ ω̃j(t) ω̃j+1(t) ] = e−Re(λj)t [ cos Im(λjt) sin Im(λjt) − sin Im(λjt) cos Im(λjt) ] [ ω̃j(0) ω̃j+1(0) ] .
Note that we re-ordered the eigenvalues such that the complex conjugate eigenvalues form pairs: if λj /∈ R then λj+1 = λ̄j .
Matrices in 2. and 3. are rotations matrices. They induce a rotational behavior illustrated in Fig 1a.
This proposition shows that the dynamics of ω(t) can be decomposed in a particular basis into attractions and rotations over components that do not interact between each other. Rotation does not appear in single objective minimization around a local minimum, because the eigenvalues of the Hessian of the objective are always real. Mescheder et al. (2017) discussed that difficulties in training GANs may be a result of the imaginary part of the eigenvalues of the Jacobian of the game vector field and Gidel et al. (2019b) mentioned that games have a natural oscillatory behavior. This cyclic behavior has been explained in (Balduzzi et al., 2018) by a non-zero Hamiltonian component in the Helmholtz decomposition of the Jacobian of the game vector field. All these explanations are related to the spectral properties of this Jacobian. The goal of Proposition 1 is to provide a formal definition to the notions of rotation and attraction we are dealing with in this paper.
In the following section, we introduce a new tool in order to assess the magnitude of the rotation around a LSSP compared to the attraction to this point.

heading: 4 VISUALIZATION FOR THE VECTOR FIELD LANDSCAPE
text: Neural networks are parametrized by a large number of variables and visualizations are only possible using low dimensional plots (1D or 2D). We first present a standard visualization tool for deep neural network loss surfaces that we will exploit in §4.2.

heading: 4.1 STANDARD VISUALIZATIONS FOR THE LOSS SURFACE
text: One way to visualize a neural network’s loss landscape is to follow a parametrized path ω(α) that connects two parameters ω,ω′ (often one is chosen early in learning and another one is chosen late in learning, close to a solution). A path is a continuous function ω(·) such that ω(0) = ω and ω(1) = ω′. Goodfellow et al. (2015) considered a linear path ω(α) = αω + (1 − α)ω′. More complex paths can be considered to assess whether different minima are connected (Draxler et al., 2018).

heading: 4.2 PROPOSED VISUALIZATION: PATH-ANGLE
text: We propose to study the linear path between parameters early in learning and parameters late in learning. We illustrate the extreme cases for the game vector field along this path in simple examples in Figure 2(a-c): pure attraction occurs when the vector field perfectly points to the optimum (Fig. 2a) and pure rotation when the vector field is orthogonal to the direction to the optimum (Fig. 2b). In practice, we expect the vector field to be in between these two extreme cases (Fig. 2c). In order to determine in which case we are, around a LSSP, in practice, we propose the following tools.
Path-norm. We first ensure that we are in a neighborhood of a stationary point by computing the norm of the vector field. Note that considering independently the norm of each player may be misleading: even though the gradient of one player may be close to zero, it does not mean that we are at a stationary point since the other player might still be updating its parameters.
Path-angle. Once we are close to a final point ω′, i.e., in a neighborhood of a LSSP, we propose to look at the angle between the vector field (3) and the linear path from ω to ω′. Specifically, we monitor the cosine of this angle, a quantity we call Path-angle:
c(α) := 〈ω ′−ω,vα〉
‖ω′−ω‖‖vα‖ where vα := v(αω ′ + (1− α)ω) , α ∈ [a, b] . (7)
Usually [a, b] = [0, 1], but since we are interested in the landscape around a LSSP, it might be more informative to also consider further extrapolated points around ω′ with b > 1.
Eigenvalues of the Jacobian. Another important tool to gain insights on the behavior close to a LSSP, as discussed in §3.2, is to look at the eigenvalues of ∇v(ω∗). We propose to compute the top-k eigenvalues of this Jacobian. When all the eigenvalues have positive real parts, we conclude that we have reached a LSSP, and if some eigenvalues have large imaginary parts, then the game has a strong rotational behavior (Thm. 1). Similarly, we can also compute the top-k eigenvalues of the diagonal blocks of the Jacobian, which correspond to the Hessian of each player. These eigenvalues can inform us on whether we have converged to a LSSP that is not a LNE.
An important advantage of the Path-angle relative to the computation of the eigenvalues of∇v(ω∗) is that it only requires computing gradients (and not second order derivatives, which may be prohibitively computationally expensive for deep networks). Also, it provides information along a whole path between two points and thus, more global information than the Jacobian computed at a single point. In the following section, we use the Path-angle to study the archetypal behaviors presented in Thm 1.

heading: 4.3 ARCHETYPAL BEHAVIORS OF THE PATH-ANGLE AROUND A LSSP
text: Around a LSSP, we have seen in (6) that the behavior of the vector field is mainly dictated by the Jacobian matrix ∇v(ω∗). This motivates the study of the behavior of the Path-angle c(α) where the Jacobian is a constant matrix:
v(ω) = [ S1 B A S2 ] (ω − ω∗) and thus ∇v(ω) = [ S1 B A S2 ] ∀ω . (8)
Depending on the choice of S1,S2,A andB, we cover the following cases:
• S1,S2 0,A = B = 0: eigenvalues are real. Thm. 1 ensures that we only have attraction. Far from ω∗, the gradient points to ω∗ (See Fig. 2a) and thus c(α) = 1 for α 1 and c(α) = −1 for α 1. Since ω′ is not exactly ω∗, we observe a quick sign switch of the Path-angle around α = 1. We plotted the average Path-angle over different approximate optima in Fig. 2a (see appendix for details). • S1,S2 = 0,A = −B>: eigenvalues are pure imaginary. Thm. 1 ensures that we only have
rotations. Far from the optimum the gradient is orthogonal to the direction that points to ω (See Fig. 2b). Thus, c(α) vanishes for α 1 and α 1. Because ω′ is not exactly ω∗, around α = 1, the gradient is tangent to the circles induced by the rotational dynamics and thus c(α) = ±1. That is why in Fig. 2b we observe a bump in c(α) when α is close to 1. • General high dimensional LSSP (4). The dynamics display both attraction and rotation.
We observe a combination of the sign switch due to the attraction and the bump due to the rotation. The higher the bump, the closer we are to pure rotations. Since we are performing a low dimensional visualization, we actually project the gradient onto our direction of interest. That is why the Path-angle is significantly smaller than 1 in Fig. 2c.

heading: 5 NUMERICAL RESULTS ON GANS
text: Losses. We focus on two common GAN loss formulations: we consider both the original nonsaturating GAN (NSGAN) formulation proposed in Goodfellow et al. (2014) and the WGAN-GP objective described in Gulrajani et al. (2017).
Datasets. We first propose to train a GAN on a toy task composed of a 1D mixture of 2 Gaussians (MoG) with 10,000 samples. For this task both the generator and discriminator are neural networks with 1 hidden layer and ReLU activations. We also train a GAN on MNIST, where we use the DCGAN architecture (Radford et al., 2016) with spectral normalization(see §C.2 for details). Finally we also look at the optimization landscape of a state of the art ResNet on CIFAR10 (Krizhevsky and Hinton, 2009).
Optimization methods. For the mixture of Gaussian (MoG) dataset, we used the full-batch extragradient method (Korpelevich, 1976; Gidel et al., 2019a). We also tried to use standard batch gradient descent, but this led to unstable results indicating that gradient descent might indeed be unable to
converge to stable stationary points due to the rotations (see §C.4). On MNIST and CIFAR10, we tested both Adam (Kingma and Ba, 2015) and ExtraAdam (Gidel et al., 2019a). The observations made on models trained with both methods are very similar. ExtraAdam gives slightly better performance in terms of inception score (Salimans et al., 2016), and Adam sometimes converge to unstable points, thus we decided to only include the observations on ExtraAdam, for more details on the observations on Adam (see §C.5). As recommended by Heusel et al. (2017), we chose different learning rates for the discriminator and the generator. All the hyper-parameters and precise details about the experiments can be found in §C.1.

heading: 5.1 EVIDENCE OF ROTATION AROUND LOCALLY STABLE STATIONARY POINTS IN GANS
text: We first look, for all the different models and datasets, at the path-angles between a random initialization (initial point) and the set of parameters during training achieving the best performance (end point) (Fig. 3), and at the eigenvalues of the Jacobian of the game vector field for the same end point (Fig. 4). We’re mostly interested in looking at the optimization landscape around LSSPs, so we first check if we are actually close to one. To do so we look at the gradient norm around the end point, this is shown by the orange curves in Fig.3, we can see that the norm of the gradient is quite small for all the models meaning that we are close to a stationary point. We also need to check that the point is stable, to do so we look at the eigenvalues of the Game in Fig. 4, if all the eigenvalues have positive real parts then the point is also stable. We observe that most of the time, the model has reached a LSSP. However we can see that this is not always the case, for example in Fig. 4d some of the eigenvalues have a negative real part. We still include those results since although the point is unstable it gives similar performance to a LSSP.
Our first observation is that all the GAN objectives on both datasets have a non zero rotational component. This can be seen by looking at the Path-angle in Fig. 3, where we always observe a bump, and this is also confirmed by the large imaginary part in the eigenvalues of the Jacobian in Fig. 4. The rotational component is clearly visible in Fig. 3d, where we see no sign switch and a clear bump similar to Fig. 2b. On MNIST and CIFAR10, with NSGAN and WGAN-GP (see Fig. 3), we observe a combination of a bump and a sign switch similar to Fig. 2c. Also Fig. 4 clearly shows the existence of imaginary eigenvalues with large magnitude. Fig. 4c and 4e. We can see that while almost all models exhibit rotations, the distribution of the eigenvalues are very different. In particular the complex eigenvalues for NSGAN seems to be much more concentrated on the imaginary axis while WGAN-GP tends to spread the eigenvalues towards the right of the imaginary axis Fig. 4e. This shows that different GAN objectives can lead to very different landscapes, and has implications in terms of optimization, in particular that might explain why WGAN-GP performs slightly better than NSGAN.
Generator
0 15 30 45 60 75 90 Top-100 Eigenvalues
0.06
0.04
0.02
0.00
0.02
0.04
0.06
0.08
M ag
ni tu
de
init end
0 2 4 6 8 10 12 14 16 18 20 Top-20 Eigenvalues
0
20
40
60
M ag
ni tu
de
init end
0 2 4 6 8 10 12 14 16 18 20 Top-20 Eigenvalues
200
0
200
400
600 800 M ag ni tu de
init end
Discriminator
0 15 30 45 60 75 90 Top-100 Eigenvalues
0
5
10
15
20
M ag
ni tu
de
init end
(a) MoG
0 2 4 6 8 10 12 14 16 18 20 Top-20 Eigenvalues
0
5000
10000
15000
20000
25000
30000
M ag
ni tu
de
init end
(b) MNIST, IS = 8.97
0 2 4 6 8 10 12 14 16 18 20 Top-20 Eigenvalues
40
30
20
10
0
10
20
30
40
M ag
ni tu
de
init end
(c) CIFAR10, IS = 7.33
Figure 5: NSGAN. Top k-Eigenvalues of the Hessian of each player (in terms of magnitude) in descending order. Top Eigenvalues indicate that the Generator does not reach a local minimum but a saddle point (for CIFAR10 actually both the generator and discriminator are at saddle points). Thus the training algorithms converge to LSSPs which are not Nash equilibria.

heading: 5.2 THE LOCALLY STABLE STATIONARY POINTS OF GANS ARE NOT LOCAL NASH EQUILIBRIA
text: As mentioned at the beginning of §5.1, the points we are considering are most of the times LSSP. To check if these points are also local Nash equilibria (LNE) we compute the eigenvalues of the Hessian of each player independently. If all the eigenvalues of each player are positive, it means that we have reached a DNE. Since the computation of the full spectrum of the Hessians is expensive, we restrict ourselves to the top-k eigenvalues with largest magnitude: exhibiting one significant negative eigenvalue is enough to indicate that the point considered is not in the neighborhood of a
LNE. Results are shown in Fig. 5 and Fig. 6, from which we make several observations. First, we see that the generator never reaches a local minimum but instead finds a saddle point. This means that the algorithm converges to a LSSP which is not a LNE, while achieving good results with respect to our evaluation metrics. This raises the question whether convergence to a LNE is actually needed or if converging to a LSSP is sufficient to reach a good solution. We also observe a large difference in the eigenvalues of the discriminator when using the WGAN-GP v.s. the NSGAN objective. In particular, we find that the discriminator in NSGAN converges to a solution with very large positive eigenvalues compared to WGAN-GP. This shows that the discriminator in NSGAN converges to a much sharper minimum. This is consistent with the fact that the gradient penalty acts as a regularizer on the discriminator and prevents it from becoming too sharp.

heading: 6 DISCUSSION
text: Across different GAN formulations, standard optimization methods and datasets, we consistently observed that GANs do not converge to local Nash equilibria. Instead the generator often ends up being at a saddle point of the generator loss function. However, in practice, these LSSP achieve really good generator performance metrics, which leads us to question whether we need a Nash equilibrium to get a generator with good performance in GANs and whether such DNE with good performance does actually exist. Moreover, we have provided evidence that the optimization landscapes of GANs typically have rotational components specific to games. We argue that these rotational components are part of the reason why GANs are challenging to train, in particular that the instabilities observed during training may come from such rotations close to LSSP. It shows that simple low dimensional examples, such as for instance Dirac GAN, does capture some of the arising challenges for training large scale GANs, thus, motivating the practical use of method able to handle strong rotational components, such as extragradient (Gidel et al., 2019a), averaging (Yazıcı et al., 2019), optimism (Daskalakis et al., 2018) or gradient penalty based methods (Mescheder et al., 2017; Gulrajani et al., 2017).
ACKNOWLEDGMENTS.
The contribution to this research by Mila, Université de Montréal authors was partially supported by the Canada CIFAR AI Chair Program (held at Mila), the Canada Excellence Research Chair in “Data Science for Realtime Decision-making”, by the NSERC Discovery Grant RGPIN-2017-06936 (held at Université de Montréal), by a Borealis AI fellowship and by a Google Focused Research award. The authors would like to thank Tatjana Chavdarova for fruitful discussions.

heading: A PROOF OF THEOREMS AND PROPOSITIONS
text: A.1 PROOF OF THEOREM 1
Let us recall the theorem of interest: Proposition’ 1. Let us assume that (6) is an equality and that ∇v(ω∗) is diagonalizable, then there exists a basis P such that the coordinates ω̃(t) := P (ω(t)− ω∗) have the following behavior,
1. For λj ∈ Sp∇v(ω∗), λj ∈ R, we observe pure attraction: ω̃j(t) = e−λjt[ω̃j(0) . 2. For λj ∈ Sp∇v(ω∗), <(λj) = 0, we observe pure rotation: [ ω̃j(t) ω̃j+1(t) ] = R|λj |t [ ω̃j(0) ω̃j+1(0) ] .
3. Otherwise, we observe both: [ ω̃j(t) ω̃j+1(t) ] = e−Re(λj)tRIm(λj)t [ ω̃j(0) ω̃j+1(0) ] .
The matrix Rϕ corresponds to a rotation of angle ϕ. Note that, we re-ordered the eigenvalues such that the complex conjugate eigenvalues form pairs: if λj /∈ R then λj+1 = λ̄j .
Proof. The ODE we consider is,
dω(t)
dt = ∇v(ω∗)(ω(t)− ω∗) (9)
The solution of this ODE is
ω(t) = e−(t−t0)∇v(ω ∗)(ω(t0)− ω∗) + ω∗ (10)
Let us now consider λ an eigenvalue of Sp(∇v(ω∗)) such that Re(λ) > 0 and Im(λ) 6= 0. Since ∇v(ω∗) is a real matrix and Im(λ) 6= 0 we know that the complex conjugate λ̄ of λ belongs to Sp(∇v(ω∗)). Let u0 be a complex eigenvector of λ, then we have that,
∇v(ω∗)u0 = λu0 ⇒ ∇v(ω∗)ū0 = λ̄ū0 (11) and thus ū0 is a eigenvector of λ̄. Now if we set u1 := u0 + ū0 and iu2 := u0 − ū0, we have that
e−t∇v(ω ∗)u1 = e −tλu0 + e −tλ̄ū0 = Re(e −tλ)u1 + Im(e −tλ)u2 (12) e−t∇v(ω ∗)iu2 = e
−tλu0 − e−tλ̄ū0 = i(Re(e−tλ)u2 − Im(e−tλ)u1) (13) Thus if we consider the basis that diagonalizes ∇v(ω∗) and modify the complex conjugate eigenvalues in the way we described right after 11 we get the expected diagonal form in a real basis. Thus there exists P such that ∇v(ω∗) = PDP−1 (14) whereD is the block diagonal matrix with the block described in Theorem 1.
A.2 BEING A DNE IS NEITHER NECESSARY OR SUFFICIENT FOR BEING A LSSP
Let us first recall Example 1. Example’ 1. Let us consider LG as a hyperbolic paraboloid (a.k.a., saddle point function) centered in (1, 1) where (1, ϕ) is the principal descent direction and (−ϕ, 1) is the principal ascent direction, while LD is a simple bilinear objective. LG(θ1, θ2, ϕ) = (θ2 − ϕθ1 − 1)2 − 12 (θ1 + ϕθ2 − 1)2 , LD(θ1, θ2, ϕ) = ϕ(5θ1 + 4θ2 − 9)
We want to show that (1, 1, 0) is a locally stable stationary point.
Proof. The game vector field has the following form,
v(θ1, θ2, ϕ) = (2ϕ2 − 1)θ1 − 3ϕθ2 + 2ϕ+ 1(2− ϕ2)θ2 − 3ϕθ1 − 2 + ϕ 5θ1 + 4θ2 − 9  (15)
Thus, (θ∗1 , θ ∗ 2 , ϕ ∗) := (1, 1, 0) is a stationary point (i.e., v(θ∗1 , θ ∗ 2 , ϕ ∗) = 0). The Jacobian of the game vector field is
∇v(θ1, θ2, ϕ) = 2ϕ2 − 1 −3ϕ 2− 3θ2−3ϕ 2− ϕ2 1− 3θ1 5 4 0  , (16) and thus,
∇v(θ∗1 , θ∗2 , ϕ∗) = (−1 0 −1
0 2 −2 5 4 0
) . (17)
We can verify that the eigenvalues of this matrix have a positive real part with any solver (the eigenvalues of a 3× 3 always have a closed form) . For completeness we provide a proof without using the closed form of the eigenvalues. The eigenvalues∇v(θ∗1 , θ∗2 , ϕ∗) are given by the roots of its characteristic polynomial,
χ(X) := ∣∣∣∣∣X + 1 0 10 X − 2 2−5 −4 0 ∣∣∣∣∣ = X3 −X2 + 11X − 2 . (18)
This polynomial has a real root in (0, 1) because χ(0) = −2 < 0 < 9 = χ(1). Thus we know that, there exists α ∈ (0, 1) such that,
X3 −X2 + 11X − 2 = (X − α)(X − λ1)(X − λ2) . (19)
Then we have the equalities,
αλ1λ2 = 2 (20) α+ λ1 + λ2 = 1 . (21)
Thus, since 0 < α < 1, we have that,
• If λ1 and λ2 are real, they have the same sign λ1λ2 = 2/α > 0) and thus are positive (λ1 + λ2 = 1− α > 0).
• If λ1 is complex then λ2 = λ̄1 and thus, 2<(λ1) = λ1 + λ2 = 1− α > 0.
Example 1 showed that LSSP did not imply DNE. Let us construct an example where a game have a DNE which is not locally stable.
Example 2. Consider the non-zero-sum game with the following respective losses for each player,
L1(θ, φ) = 4θ2 + ( 12φ2 − 1) · θ and L2(θ, φ) = (4θ − 1)φ+ 16θ3 (22)
This game has two stationary points for θ = 0 and φ = ±1. The Jacobian of the dynamics at these two points are
∇v(0, 1) = (
1 1/2 2 1/2
) and ∇v(0,−1) = ( 1 −1/2 2 −1/2 ) (23)
Thus,
• The stationary point (0, 1) is a DNE but Sp(∇v(0, 1)) = { 3± √
17 4 } contains an eigenvalue
with negative real part and so is not a LSSP.
• The statioanry point (0,−1) is not a DNE but Sp(∇v(0, 1)) = { 1±i √
7 4 } contains only
eigenvalue with positive real part and so is a LSSP.

heading: B COMPUTATION OF THE TOP-K EIGENVALUES OF THE JACOBIAN
text: Neural networks usually have a large number of parameters, this usually makes the storing of the full Jacobian matrix impossible. However the Jacobian vector product can be efficiently computed by using the trick from (Pearlmutter, 1994). Indeed it’s easy to show that∇v(ω)u = ∇(v(ω)Tu). To compute the eigenvalues of the Jacobian of the Game, we first compute the gradient v(ω) over a subset of the dataset. We then define a function that computes the Jacobian vector product using automatic differentiation. We can then use this function to compute the top-k eigenvalues of the Jacobian using the sparse.linalg.eigs functions of the Scipy library.

heading: C EXPERIMENTAL DETAILS
text: C.1 MIXTURE OF GAUSSIAN EXPERIMENT
Dataset. The Mixture of Gaussian dataset is composed of 10,000 points sampled independently from the following distribution pD(x) = 12N (2, 0.5) + 12N (−2, 1) where N (µ, σ2) is the probability density function of a 1D-Gaussian distribution with mean µ and variance σ2. The latent variables z ∈ Rd are sampled from a standard Normal distributionN (0, Id). Because we want to use full-batch methods, we sample 10,000 points that we re-use for each iteration during training.
Neural Networks Architecture. Both the generator and discriminator are one hidden layer neural networks with 100 hidden units and ReLU activations.
WGAN Clipping. Because of the clipping of the discriminator parameters some components of the gradient of the discriminator’s gradient should no be taken into account. In order to compute the relevant path angle we apply the following filter to the gradient:
1 {(|ϕ| = c) and (sign∇ϕLD(ω) = −signϕ)} (24) where ϕ is clipped between −c and c. If this condition holds for a coordinate of the gradient then it mean that after a gradient step followed by a clipping the value of the coordinate will not change.
Hyperparameters for WGAN-GP on MoG Batch size = 10, 000 (Full-Batch) Number of iterations = 30, 000 Learning rate for generator = 1× 10−2 Learning rate for discriminator = 1× 10−1 Gradient Penalty coefficient = 1× 10−3
Hyperparameters for NSGAN on MoG Batch size = 10, 000 (Full-Batch) Number of iterations = 30, 000 Learning rate for generator = 1× 10−1 Learning rate for discriminator = 1× 10−1
C.2 MNIST EXPERIMENT
Dataset We use the training part of MNIST dataset LeCun et al. (2010) (50K examples) for training our models, and scale each image to the range [−1, 1]. Architecture We use the DCGAN architecture Radford et al. (2016) for our generator and discriminator, with both the NSGAN and WGAN-GP objectives. The only change we make is that we replace the Batch-norm layer in the discriminator with a Spectral-norm layer Miyato et al. (2018), which we find to stabilize training.
Training Details
Hyperparameters for NSGAN with Adam Batch size = 100 Number of iterations = 100, 000 Learning rate for generator = 2× 10−4 Learning rate for discriminator = 5× 10−5 β1 = 0.5
Hyperparameters for NSGAN with ExtraAdam Batch size = 100 Number of iterations = 100, 000 Learning rate for generator = 2× 10−4 Learning rate for discriminator = 5× 10−5 β1 = 0.9
Hyperparameters for WGAN-GP with Adam Batch size = 100 Number of iterations = 200, 000 Learning rate for generator = 8.6× 10−5 Learning rate for discriminator = 8.6× 10−5 β1 = 0.5 Gradient penalty λ = 10 Critic per Gen. iterations λ = 5
Hyperparameters for WGAN-GP with ExtraAdam Batch size = 100 Number of iterations = 200, 000 Learning rate for generator = 8.6× 10−5 Learning rate for discriminator = 8.6× 10−5 β1 = 0.9 Gradient penalty λ = 10 Critic per Gen. iterations λ = 5
Computing Inception Score on MNIST We compute the inception score (IS) for our models using a LeNet classifier pretrained on MNIST. The average IS score of real MNIST data is 9.9.
C.3 PATH-ANGLE PLOT
We use the path-angle plot to illustrate the dynamics close to a LSSP. To compute this plot, we need to choose an initial point ω and an end point ω′. We choose the ω to be the parameters at initialization, but ω′ can more subtle to choose. In practice, when we use stochastic gradient methods we typically reach a neighborhood of a LSSP where the norm of the gradient is small. However, due to the stochastic noise, we keep moving around the LSSP. In order to be robust to the choice of the end point ω′, we take multiple close-by points during training that have good performance (e.g., high IS in MNIST). In all of figures, we compute the path-angle (and path-norm) for all these end points (with the same start point), and we plot the median path-angle (middle line) and interquartile range (shaded area).
C.4 INSTABILITY OF GRADIENT DESCENT
For the MoG dataset we tried both the extragradient method (Korpelevich, 1976; Gidel et al., 2019a) and the standard gradient descent. We observed that gradient descent leads to unstable results. In
particular the norm of the gradient has very large variance compared to extragradient this is shown in Fig. 7.
C.5 ADDITIONAL RESULTS WITH ADAM

Review summaries:
This paper proposes visualization techniques for the optimization landscape in GANs. The primary tool presented in this paper is a quantity called path-angle, which looks at the angle between the game vector field and the linear path between a point away from a stationary point and a point near a stationary point. The paper present examples of the visualization for dynamics with pure attraction, pure rotation, and a mix of attraction and rotation. Along with this, the authors propose to look at the eigenvalues of the game Jacobian and the individual player Hessian’s to evaluate convergence in GANs. The paper presents application of the tools on GANs trained with NSGAN and WGAN-GP objectives on a mixture of Gaussians, MNIST, and CIFAR10. The primary observation is that the generator performance is good, but the algorithms converge to non-Nash stable attractors. Moreover, it is shown using the path-angle plots that GANs exhibit rotational behavior around stable points.

This paper tries to provide a deeper understanding of the training dynamics of GANs in practice via characterizing and visualizing the rotation and attraction phenomena nearby a locally stable stationary point (LSSP) and questions the necessity to access a differential/local Nash equilibrium (LNE). In particular, this paper first discusses the difference between LSSP and LNE and formalize the notions of rotation and attraction around LSSP in games. Then, this paper proposes the path angle to visualize the rotation and attraction nearby an LSSP. The path angle is a function that maps linearly distributed points in the line, which is determined by an initial parameter set and a well-trained parameter set, to the angles between the line and the gradient of a given point in that line. The rotation and attraction phenomena can be observed in the plot of the path angle as  "a quick sign switch" and "a bump" nearby 1, respectively. The experiments empirically demonstrate that: 1. rotation exists in the training dynamics of practical GANs; 2. GANs often converge to an LSSP than an LNE, but still, achieve good results.