Year: 2018

Abstract:
Although stochastic gradient descent (SGD) is a driving force behind the recent success of deep learning, our understanding of its dynamics in a high-dimensional parameter space is limited. In recent years, some researchers have used the stochasticity of minibatch gradients, or the signal-to-noise ratio, to better characterize the learning dynamics of SGD. Inspired by these work, we here analyze SGD from a geometrical perspective by inspecting the stochasticity of the norms and directions of minibatch gradients. We propose a model of the directional concentration for minibatch gradients through von Mises-Fisher distribution and show that the directional uniformity of minibatch gradients increases over the course of SGD. We empirically verify our result using deep convolutional networks and observe a higher correlation between the gradient stochasticity and the proposed directional uniformity than that against the gradient norm stochasticity, suggesting that the directional statistics of minibatch gradients is a major factor behind SGD.

heading: 1 INTRODUCTION
text: Stochastic gradient descent (SGD) has been a driving force behind the recent success of deep learning. Despite a series of work on improving SGD by incorporating the second-order information of the objective function (Roux et al., 2008; Martens, 2010; Dauphin et al., 2014; Martens & Grosse, 2015; Desjardins et al., 2015), SGD is still the most widely used optimization algorithm for training a deep neural network. The learning dynamics of SGD, however, has not been well characterized beyond that it converges to an extremal point (Bottou, 1998) due to the non-convexity and highdimensionality of a usual objective function used in deep learning.
Gradient stochasticity, or the signal-to-noise ratio (SNR) of the stochastic gradient, has been proposed as a tool for analyzing the learning dynamics of SGD. Shwartz-Ziv & Tishby (2017) identified two phases in SGD based on this. In the first phase, “drift phase”, the gradient mean is much higher than its standard deviation, during which optimization progresses rapidly. This drift phase is followed by the “diffusion phase”, where SGD behaves similarly to Gaussian noise with very small means. Similar observations were made by Li & Yuan (2017) and Chee & Toulis (2018) who have also divided the learning dynamics of SGD into two phases.
Shwartz-Ziv & Tishby (2017) have proposed that such phase transition is related to information compression. Unlike them, we notice that there are two aspects to the gradient stochasticity. One is the L2 norm of the minibatch gradient (the norm stochasticity), and the other is the directional balance of minibatch gradients (the directional stochasticity). SGD converges or terminates when either the norm of the minibatch gradient vanishes to zeros, or when the angles of the minibatch gradients are uniformly distributed and their non-zero norms are close to each other. That is, the gradient stochasticity, or the SNR of the stochastic gradient, is driven by both of these aspects, and it is necessary for us to investigate not only the holistic SNR but also the SNR of the minibatch gradient norm and that of the minibatch gradient angles.
In this paper, we use a von Mises-Fisher (vMF hereafter) distribution, which is often used in directional statistics (Mardia & Jupp, 2009), and its concentration parameter κ to characterize the directional balance of minibatch gradients and understand the learning dynamics of SGD from the perspective of directional statistics of minibatch gradients. We prove that SGD increases the direc-
tional balance of minibatch gradients. We empirically verify this with deep convolutional networks with various techniques, including batch normalization (Ioffe & Szegedy, 2015) and residual connections (He et al., 2015), on MNIST and CIFAR-10 (Krizhevsky & Hinton, 2009). Our empirical investigation further reveals that the proposed directional stochasticity is a major drive behind the gradient stochasticity compared to the norm stochasticity, suggesting the importance of understanding the directional statistics of the stochastic gradient.
Contribution We analyze directional stochasticity of the minibatch gradients via angles as well as the concentration parameter of the vMF distribution. Especially, we theoretically show that the directional uniformity of the minibatch gradients modeled by the vMF distribution increases as training progresses, and verify this by experiments. In doing so, we introduce gradient norm stochasticity as the ratio of the standard deviation of the minibatch gradients to their expectation and theoretically and empirically show that this gradient norm stochasticity decreases as the batch size increases.
Related work Most studies about SGD dynamics have been based on two-phase behavior (Shwartz-Ziv & Tishby, 2017; Li & Yuan, 2017; Chee & Toulis, 2018). Li & Yuan (2017) investigated this behavior by considering a shallow neural network with residual connections and assuming the standard normal input distribution. They showed that SGD-based learning under these setups has two phases; search and convergence phases. Shwartz-Ziv & Tishby (2017) on the other hand investigated a deep neural network with tanh activation functions, and showed that SGD-based learning has drift and diffusion phases. They have also proposed that such SNR transition (drift + diffusion) is related to the information transition divided into empirical error minimization and representation compression phases. However, Saxe et al. (2018) have reported that the information transition is not generally associated with the SNR transition with ReLU (Nair & Hinton, 2010) activation functions. Chee & Toulis (2018) instead looked at the inner product between successive minibatch gradients and presented transient and stationary phases.
Unlike our work here, the experimental verification of the previous work conducted under limited settings – the shallow network (Li & Yuan, 2017), the specific activation function (Shwartz-Ziv & Tishby, 2017), and only MNIST dataset (Shwartz-Ziv & Tishby, 2017; Chee & Toulis, 2018) – that conform well with their theoretical assumptions. Moreover, their work does not offer empirical result about the effect of the latest techniques including both batch normalization (Ioffe & Szegedy, 2015) layers and residual connections (He et al., 2015).

heading: 2 PRELIMINARIES
text: Norms and Angles Unless explicitly stated, a norm refers to L2 norm. ‖ · ‖ and 〈·, ·〉 thus correspond to L2 norm and the Euclidean inner product on Rd, respectively. We use xn ⇒ x to indicate that “a random variable xn converges to x in distribution.” Similarly, xn
P→ x means convergence in probability. An angle θ between d-dimensional vectors u and v is defined by θ = 180π cos −1 ( 〈u,v〉 ‖u‖‖v‖ ) . Loss functions A loss function of a neural network is written as f(w) = 1n ∑n i=1 fi(w), where w ∈ Rd is a trainable parameter. fi is “a per-example loss function” computed on the i-th data point. We use I and m to denote a minibatch index set and its batch size, respectively. Further, we call fI(w) = 1m ∑ i∈I fi(w) “a minibatch loss function given I”. In Section 3.1, we use gi(w) and ĝ(w) to denote −∇wfi(w) and −∇wfI(w), respectively. In Section 3.3, the index i is used for the corresponding minibatch index set Ii. For example, the negative gradient of fIi(w) is written as ĝi(w). During optimization, we denote a parameter w at the i-th iteration in the t-th epoch as wit, and w00 is an initial parameter. We use nb to refer to the number of minibatches in a single epoch.
von Mises-Fisher Distribution We use the von Mises-Fisher (vMF) distribution to model the directions of vectors. The definition of the vMF distribution is as follows:
Definition 1. (von Mises-Fisher Distribution, Banerjee et al. (2005)) The pdf of the vMF(µ, κ) is given by
fd(x;µ, κ) = Cd(κ) exp(κµ >x)
on the hypersphere Sd−1 ⊂ Rd. Here, the concentration parameter κ determines how the samples from this distribution are concentrated on the mean direction µ and Cd(κ) is constant determined by d and κ.
If κ is zero, then it is a uniform distribution on the unit hypersphere, and as κ → ∞, it becomes a point mass on the unit hypersphere (Figure 1). The maximum likelihood estimates for µ and κ are µ̂ = ∑n i=1 xi ‖ ∑n i=1 xi‖ and κ̂ ≈ r̄(d−r̄ 2) 1−r̄2 where xi’s are random samples from the vMF distribution and r̄ =
‖ ∑n
i=1 xi‖ n . The formula for κ̂ is approximate since the exact computation is intractable (Banerjee
et al., 2005).

heading: 3 THEORETICAL MOTIVATION

heading: 3.1 ANALYSIS OF THE GRADIENT NORM STOCHASTICITY
text: It is a usual practice for SGD to use a minibatch gradient ĝ(w) = −∇wfI(w) instead of a full batch gradient g(w) = −∇wf(w). The minibatch index set I is drawn from {1,. . . ,n} randomly. ĝ(w) satisfies E[ĝ(w)] = g(w) and Cov(ĝ(w), ĝ(w)) ≈ 1mn ∑n i=1 gi(w)gi(w)
> for n m where n is the number of full data points and gi(w) = −∇wfi(w) (Hoffer et al., 2017). As the batch size m increases, the randomness of ĝ(w) decreases. Hence E‖ĝ(w)‖ tends to ‖g(w)‖, and Var(‖ĝ(w)‖), which is the variance of the norm of the minibatch gradient, vanishes. The convergence rate analysis is as the following:
Theorem 1. Let ĝ(w) be a minibatch gradient induced from the minibatch index set I of batch size m from {1, . . . , n} and suppose γ = maxi,j∈{1,...,n} | 〈gi(w), gj(w)〉 |. Then
0 ≤ E‖ĝ(w)‖ − ‖g(w)‖ ≤ 2(n−m) m(n− 1) × γ E‖ĝ(w)‖+ ‖g(w)‖ ≤ (n−m)γ m(n− 1)‖g(w)‖
and
Var(‖ĝ(w)‖) ≤ 2(n−m) m(n− 1) γ .

heading: Hence, √
text: Var(‖ĝ(w)‖) E‖ĝ(w)‖ ≤ √ 2(n−m) m(n− 1) × γ ‖g(w)‖2 . (1)
Proof. See Supplemental A.
According to Theorem 1, a large batch sizem reduces the variance of ‖ĝ(w)‖ centered at E‖ĝ(w)‖ with convergence rate O(1/m). We empirically verify this by estimating the gradient norm stochasticity at random points while varying the minibatch size, using a fully-connected neural network (FNN) with MNIST, as shown in Figure 2(a) (see Supplemental E for more details.)
This theorem however only demonstrate that the gradient norm stochasticity is (l.h.s. of (1)) is low at random initial points. It may blow up after SGD updates, since the upper bound (r.h.s. of (1)) is inversely proportional to ‖g(w)‖. This implies that the learning dynamics and convergence of SGD, measured in terms of the vanishing gradient, i.e., ∑nb i=1 ĝi(w) ≈ 0, is not necessarily explained by the vanishing norms of minibatch gradients, but rather by the balance of the directions of ĝi(w)’s, which motivates our investigation of the directional statistics of minibatch gradients. See Figure 2(b) as an illustration.

heading: 3.2 UNIFORMITY MEASUREMENT VIA ANALYSIS OF ANGLES
text: In order to investigate the directions of minibatch gradients and how they balance, we start from an angle between two vectors. First, we analyze an asymptotic behavior of angles between uniformly random unit vectors in a high-dimensional space.
Theorem 2. Suppose that u and v are mutually independent d-dimensional uniformly random unit vectors. Then,
√ d×
( 180
π cos−1 〈u,v〉 − 90
) ⇒ N ( 0, (180 π )2) as d→∞.
Proof. See Supplemental B.
According to Theorem 2, the angle between two independent uniformly random unit vectors is normally distributed and becomes increasingly more concentrated as d grows (Figure 3(a)). If SGD iterations indeed drive the directions of minibatch gradients to be uniform, then, at least, the distribution of angles between minibatch gradients and a given uniformly sampled unit vector follows asymptotically
N ( 90, ( 180 π √ d )2) . (2)
Figures 3(b) and 3(c) show that the distribution of the angles between minibatch gradients and a given uniformly sampled unit vector converges to an asymptotic distribution (2) after SGD iterations. Although we could measure the uniformity of minibatch gradients how the angle distribution between minibatch gradients is close to (2), it is not as trivial to compare the distributions as to compare numerical values. This necessitates another way to measure the uniformity of minibatch gradients.

heading: 3.3 UNIFORMITY MEASUREMENT VIA VMF DISTRIBUTION
text: To model the uniformity of minibatch gradients, we propose to use the vMF distribution in Definition 1. The concentration parameter κ measures how uniformly the directions of unit vectors are distributed. By Theorem 1, with a large batch size, the norm of minibatch gradient is nearly deterministic, and µ̂ is almost parallel to the direction of full batch gradient. In other words, κ measures the concentration of the minibatch gradients directions around the full batch gradient.
The following Lemma 1 introduces the relationship between the norm of averaged unit vectors and κ̂, the approximate estimator of κ. Lemma 1. The approximated estimator of κ induced from the d-dimensional unit vectors {x1,x2, · · · ,xnb},
κ̂ = r̄(d− r̄2)
1− r̄2 ,
is a strictly increasing function on [0, 1], where r̄ = ‖ ∑nb
i=1 xi‖ nb
. If we consider κ̂ = h(u) as a function of u = ‖ ∑nb i=1 xi‖, then h(·) is Lipschitz continuous on [0, nb(1 − )] for any > 0. Moreover, h(·) and h′(·) are strictly increasing and increasing on [0, nb), respectively.
Proof. See Supplemental C.1.
Consider
κ̂(w) = h (∥∥∥∥∥ nb∑ i=1 pi −w ‖pi −w‖ ∥∥∥∥∥ ) ,
which is measured from the directions from the current location w to the fixed points pi’s, where h(·) is a function defined in Lemma 1. Since h(·) is an increasing function, we may focus only on ‖ ∑nb i=1 pi−w ‖pi−w‖‖ to see how κ̂ behaves with respect to its argument. Lemma 2 implies that the estimated directional concentration κ̂ decreases if we move away from w00 to w ′ = w00 +
∑ i pi−w00 ‖pi−w00‖ with a small (Figure 4(a)). In other words, κ̂(w′) < κ̂(w00).
Lemma 2. Let p1,p2, · · · ,pnb be d-dimensional vectors. If all pi’s are not on a single ray from the current location w, then there exists positive number η such that∥∥∥∥∥∥ nb∑ j=1 pj −w − ∑nb i=1 pi−w ‖pi−w‖∥∥∥pj −w − ∑nbi=1 pi−w‖pi−w‖∥∥∥ ∥∥∥∥∥∥ < ∥∥∥∥∥ nb∑ i=1 pi −w ‖pi −w‖ ∥∥∥∥∥
for all ∈ (0, η].
Proof. See Supplemental C.2.
We make the connection between the observation above and SGD by first viewing pi’s as local minibatch solutions. Definition 2. For a minibatch index set Ii, pi(w) = arg minw′∈N(w;ri)fIi(w
′) is a local minibatch solution of Ii at w, where N(w; ri) is a neighborhood of radius ri at w. Here, ri is determined by w and Ii for pi(w) to exist uniquely.
Under this definition, pi(w) is local minimum of a minibatch loss function fIi near w. Then we reasonably expect that the direction of ĝi(w) = −∇wfIi(w) is similar to that of pi(w)−w.
Each epoch of SGD with a learning rate η computes a series of wjt = w 0 t + η ∑j i=1 ĝi(w i−1 t ) for all j ∈ {1, . . . , nb}. If ĝi(·)’s are Lipschitz continuous for all i ∈ {1, . . . , nb}, then we have ‖ĝi(wi−1t )‖ ≈ ‖ĝi(w0t )‖ for a small η. Moreover, Theorem 1 implies ‖ĝi(w0t )‖ ≈ τ for all i ∈ {1, . . . , nb} with a large batch size or at the early stage of SGD iterations. Combining these approximations, ‖ĝi(wi−1t )‖ ≈ τ for all i ∈ {1, . . . , nb}. For example, suppose that t = 0, nb = 3 and τ = 1, and assume that pi(w00) = pi(w 0 1) = pi for all i = 1, 2, 3. Then,
κ̂(w00) = h (∥∥∥∥∥ 3∑ i=1 pi −w00 ‖pi −w00‖ ∥∥∥∥∥ ) ,
and
κ̂(w01) ≈ h  ∥∥∥∥∥∥∥ 3∑ j=1 pj −w00 − η ∑3 i=1 ĝi(w i−1 0 ) ‖ĝi(wi−10 )‖∥∥∥pj −w00 − η∑3i=1 ĝi(wi−10 )‖ĝi(wi−10 )‖∥∥∥ ∥∥∥∥∥∥∥  .
If η ∑ i pi−w00 ‖pi−w00‖ ≈ η ∑ i ĝi(w i−1 0 ) ‖ĝi(wi−10 )‖ , then
3∑ j=1
pj −w00 − η ∑3 i=1 ĝi(w i−1 0 )
‖ĝi(wi−10 )‖∥∥∥pj −w00 − η∑3i=1 ĝi(wi−10 )‖ĝi(wi−10 )‖∥∥∥ ≈ 3∑ j=1
pj −w00 − η ∑3 i=1
pi−w00 ‖pi−w00‖∥∥∥pj −w00 − η∑3i=1 pi−w00‖pi−w00‖∥∥∥ .
Hence, we have κ̂(w01) < κ̂(w 0 0) by Lemma 2. A trivial case satisfying this condition would be for each pair of pi −w00 and ĝi(wi−10 ) to be approximately parallel, as illustrated in Figure 4(b).
Theorem 3. Let p1(w0t ),p2(w0t ), · · · ,pnb(w0t ) be d-dimensional vectors, and all pi(w0t )’s are not on a single ray from the current location w0t . If∥∥∥∥∥ nb∑ i=1 pi(w 0 t )−w0t ‖pi(w0t )−w0t ‖ − nb∑ i=1 ĝi(w i−1 t ) ‖ĝi(wi−1t )‖ ∥∥∥∥∥ ≤ ξ (3) for a sufficiently small ξ > 0, then there exists positive number η such that∥∥∥∥∥∥ nb∑ j=1 pj(w 0 t )−w0t − ∑nb i=1 ĝi(w i−1 t ) ‖ĝi(wi−1t )‖∥∥∥pj(w0t )−w0t − ∑nbi=1 ĝi(wi−1t )‖ĝi(wi−1t )‖∥∥∥ ∥∥∥∥∥∥ < ∥∥∥∥∥ nb∑ i=1 pi(w 0 t )−w0t ‖pi(w0t )−w0t ‖
∥∥∥∥∥ (4) for all ∈ (0, η].
Proof. See Supplemental C.3.
This Theorem 3 asserts that κ̂(·) decreases even with some perturbation along the averaged direction∑ i pi(w)−w ‖pi(w)−w‖ . With additional assumptions on each minibatch loss functions, we have a sufficient condition for (3), summarized in Corollary 3.1. Corollary 3.1. Let pi be the local minibatch solution of each fIi . Suppose a regionR satisfying:
For all w,w′ ∈ R, pi(w) = pi(w′) = pi for all i = 1, · · · , nb. Further, assume that Hessian matrices of fIi ’s are positive definite, wellconditioned, and bounded in the sense of matrix L2-norm on R. If SGD moves from w0t to w0t+1 on R with a large batch size and a small learning rate, then κ̂(w0t ) > κ̂(w0t+1). Moreover, we can estimate κ̂(w0t ) and κ̂(w 0 t+1) by minibatch gradients at w 0 t and w 0 t+1, respectively.
Proof. See Supplemental D.
Without the corollary above, we need to solve pi(w0t ) = arg minw∈N(w0t ;r) fIi(w) for all i ∈ {1, . . . , ns}, where ns is the number of samples to estimate κ, in order to compute κ̂(w0t ). Corollary 3.1 however implies that we can compute κ̂(w0t ) by using ĝi(w 0 t )
‖ĝi(w0t )‖ instead of pi(w
0 t )−w 0 t
‖pi(w0t )−w0t ‖ ,
significantly reducing computational overhead. In Practice Although the number of all possible minibatches in each epoch is nb = ( n m ) , it is often the case to use n′b ≈ n/m minibatches at each epoch in practice to go from w0t to w0t+1. Assuming that these n′b minibatches were selected uniformly at random, the average of the n ′ b normalized minibatch gradients is the maximum likelihood estimate of µ, just like the average of all nb normalized minibatch gradients. Thus, we expect with a large n′b,∥∥∥∥∥∥∥ (nm)∑ i=1 pi(w 0 t )−w0t ‖pi(w0t )−w0t ‖ − n′b∑ i=1 ĝi(w i−1 t ) ‖ĝi(wi−1t )‖
∥∥∥∥∥∥∥ ≤ ξ, and that SGD in practice also satisfies κ̂(w0t ) > κ̂(w 0 t+1).

heading: 4 EXPERIMENTS

heading: 4.1 SETUP
text: In order to empirically verify our theory on directional statistics of minibatch gradients, we train various types of deep neural networks using SGD and monitor the following metrics for analyzing the learning dynamics of SGD:
• Training loss
• Validation loss • Gradient stochasticity (GS)↑ ‖E∇wfIi(w)‖/ √ tr(Cov(∇wfIi(w),∇wfIi(w)) ↓
• Gradient norm stochasticity (GNS) ↑ E‖∇wfIi(w)‖/ √
Var(‖∇wfIi(w)‖) ↓ • Directional Uniformity↑ κ ↓
The latter three quantities are statistically estimated using ns = 3, 000 minibatches. We use κ̂ to denote the κ estimate.
We train the following types of deep neural networks (Supplemental E):
• FNN: a fully connected network with a single hidden layer • DFNN: a fully connected network with three hidden layers • CNN: a convolutional network with 14 layers (Krizhevsky et al., 2012)
In the case of the CNN, we also evaluate its variant with skip connections (+Res) (He et al., 2015). As it was shown recently by Santurkar et al. (2018) that batch normalization (Ioffe & Szegedy, 2015) improves the smoothness of a loss function in terms of its Hessian, we also test adding batch normalization to each layer right before the ReLU (Nair & Hinton, 2010) nonlinearity (+BN). We use MNIST for the FNN, DFNN and their variants, while CIFAR-10 (Krizhevsky & Hinton, 2009) for the CNN and its variants.
Our theory suggests a sufficiently large batch size for verification. We empirically analyze how large a batch size is needed in Figure 5. From these plots, κ̂ decreases monotonically regardless of the minibatch size, but the variance over multiple training runs is much smaller with a larger minibatch size. We thus decide to use a practical size of 64. With this fixed minibatch size, we use a fixed learning rate of 0.01, which allows us to achieve the training accuracy of > 99.9% for every training run in our experiments. We repeat each setup five times starting from different random initial parameters and report both the mean and standard deviation.

heading: 4.2 DIRECTIONAL UNIFORMITY INCREASES
text: FNN and DFNN We first observe that κ̂ decreases over training regardless of the network’s depth in Figure 6 (a,b). We however also notice that κ̂ decrease monotonically with the FNN, but less so with its deeper variant (DFNN). We conjecture this is due to the less-smooth loss landscape of a deep neural network. This difference between FNN and DFNN however almost entirely vanishes when batch normalization (+BN) is applied (Figure 6 (e,f)). This was expected as batch normalization is known to make the loss function behave better, and our theory assumes a smooth objective function.
CNN The CNN is substantially deeper than either FNN or DFNN and is trained on a substantially more difficult problem of CIFAR-10. In other words, the assumptions underlying our theory may not hold as well. Nevertheless, as shown in Figure 6 (c), κ̂ eventually drops below its initial point, although this trend is not monotonic and κ̂ fluctuates significantly over training. The addition of batch normalization (+BN) helps with the fluctuation but κ̂ does not monotonically decrease
(Figure 6 (g)). On the other hand, we observe the monotonic decrease of κ̂ when skip connections (+Res) are introduced (Figure 6 (c) vs. Figure 6 (d)) albeit still with some level of fluctuation especially in the early stage of learning. When both batch normalization and skip connections are used (+Res+BN), the behaviour of κ̂ matches with our prediction without much fluctuation.
Effect of +BN and +Res Based on our observations that the uniformity of minibatch gradients increases monotonically, when a deep neural network is equipped with residual connection (+Res) and trained with batch normalization (+BN), we conjecture that the loss function induced from these two techniques better satisfies the assumptions underlying our theoretical analysis, such as its well-behavedness. This conjecture is supported by for instance Santurkar et al. (2018), who demonstrated batch normalization guarantees the boundedness of Hessian, and Orhan & Pitkow (2017), who showed residual connections eliminate some singularities of Hessian.
κ̂ near the end of training The minimum average κ̂ of DFNN+BN, which has 1, 920, 000 parameters, is 71, 009.20, that of FNN+BN, which has 636, 800 parameters, is 23, 059.16, and that of CNN+BN+Res, which has 207, 152 parameters, is 20, 320.43. These average κ̂ are within a constant multiple of estimated κ using 3,000 samples from the vMF distribution with true κ = 0 (35, 075.99 with 1, 920, 000 dimensions, 11, 621.63 with 636, 800 dimensions, and 3, 781.04 with 207, 152 dimensions.) This implies that we cannot say that the underlying directional distribution of minibatch gradients in all these cases at the end of training is not close to uniform (Cutting et al., 2017). For more detailed analysis, see Supplementary F.

heading: 4.3 DIRECTIONAL UNIFORMITY AND OTHER METRICS
text: The gradient stochasticity (GS) was used by Shwartz-Ziv & Tishby (2017) as a main metric for identifying two phases of SGD learning in deep neural networks. This quantity includes both the gradient norm stochasticity (GNS) and the directional uniformity κ, implying that either or both of GNS and κ could drive the gradient stochasticity. We thus investigate the relationship among these three quantities as well as training and validation losses. We focus on CNN, CNN+BN and CNN+Res+BN trained on CIFAR-10.
From Figure 7 (First row), it is clear that the proposed metric of directional uniformity κ̂ correlates better with the gradient stochasticity than the gradient norm stochasticity does. This was especially prominent during the early stage of learning, suggesting that the directional statistics of minibatch gradients is a major explanatory factor behind the learning dynamics of SGD. This difference in correlations is much more apparent from the scatter plots in Figure 7 (Second row). We show these plots created from other four training runs per setup in Supplemental G.

heading: 5 CONCLUSION
text: Stochasticity of gradients is a key to understanding the learning dynamics of SGD (Shwartz-Ziv & Tishby, 2017) and has been pointed out as a factor behind the success of SGD (see, e.g., LeCun et al., 2012; Keskar et al., 2016). In this paper, we provide a theoretical framework using von Mises-Fisher distribution, under which the directional stochasticity of minibatch gradients can be estimated and analyzed, and show that the directional uniformity increases over the course of SGD. Through the extensive empirical evaluation, we have observed that the directional uniformity indeed improves over the course of training a deep neural network, and that its trend is monotonic when batch normalization and skip connections were used. Furthermore, we demonstrated that the stochasticity of minibatch gradients is largely determined by the directional stochasticity rather than the gradient norm stochasticity.
Our work in this paper suggests two major research directions for the future. First, our analysis has focused on the aspect of optimization, and it is an open question how the directional uniformity relates to the generalization error although handling the stochasticity of gradients has improved SGD (Neelakantan et al., 2015; Hoffer et al., 2017; Smith et al., 2017; Jin et al., 2017). Second, we have focused on passive analysis of SGD using the directional statistics of minibatch gradients, but it is not unreasonable to suspect that SGD could be improved by explicitly taking into account the directional statistics of minibatch gradients during optimization.

heading: SUPPLEMENTARY MATERIAL

heading: A PROOFS FOR THEOREM 1
text: In proving Theorem 1, we use Lemma A.1. Define selector random variables(Hoffer et al., 2017) as below: si = {
1, if i ∈ I 0, if i /∈ I .
Then we have
ĝ(w) = 1
m n∑ i=1 gi(w)si.
Lemma A.1. Let ĝ(w) be a minibatch gradient induced from the minibatch index set I with batch size m from {1, . . . , n}. Then
0 ≤ E‖ĝ(w)‖2 − ‖g(w)‖2 ≤ 2(n−m) m(n− 1) γ. (5)
where γ = maxi,j∈{1,...,n} | 〈gi(w), gj(w)〉 |.
Proof. By Jensen’s inequality, 0 ≤ E‖ĝ(w)‖2 − ‖g(w)‖2. Note that
E‖ĝ(w)‖2 = n∑ i=1 n∑ j=1 1 m2 〈gi(w), gj(w)〉E[sisj ].
Since E[sisj ] = mn δij + m(m−1) n(n−1) (1− δij),
E‖ĝ(w)‖2 − ‖g(w)‖2 = ( 1 mn − m− 1 mn(n− 1) ) n∑ i=1 〈gi(w), gi(w)〉
+ ( m− 1 mn(n− 1) − 1 n2 ) n∑ i=1 n∑ j=1 〈gi(w), gj(w)〉
= ( 1 mn − m− 1 mn(n− 1) ) n∑ i=1 〈gi(w), gi(w)〉
+ m− n
mn2(n− 1) n∑ i=1 n∑ j=1 〈gi(w), gj(w)〉
≤ ( 1 mn − m− 1 mn(n− 1) ) nγ + n−m mn2(n− 1) n2γ
= 2(n−m) m(n− 1) γ
where γ = maxi,j∈{1,...,n} | 〈gi(w), gj(w)〉 |.
Theorem 1. Let ĝ(w) be a minibatch gradient induced from the minibatch index set I of batch size m from {1, . . . , n} and suppose γ = maxi,j∈{1,...,n} | 〈gi(w), gj(w)〉 |. Then
0 ≤ E‖ĝ(w)‖ − ‖g(w)‖ ≤ 2(n−m) m(n− 1) × γ E‖ĝ(w)‖+ ‖g(w)‖ ≤ (n−m)γ m(n− 1)‖g(w)‖
and
Var(‖ĝ(w)‖) ≤ 2(n−m) m(n− 1) γ .

heading: Hence, √
text: Var(‖ĝ(w)‖) E‖ĝ(w)‖ ≤ √ 2(n−m) m(n− 1) × γ ‖g(w)‖2 .
Proof. By Jensen’s inequality, we have ‖g(w)‖ = ‖E[ĝ(w)]‖ ≤ E‖ĝ(w)‖ and (E‖ĝ(w)‖)2 ≤ E‖ĝ(w)‖2. From the second inequality and Lemma A.1,
(E‖ĝ(w)‖)2 ≤ E‖ĝ(w)‖2 ≤ ‖g(w)‖2 + 2(n−m) m(n− 1) γ
or ( E‖ĝ(w)‖ − ‖g(w)‖ )( E‖ĝ(w)‖+ ‖g(w)‖ ) ≤ 2(n−m) m(n− 1) γ .
Hence
E‖ĝ(w)‖ ≤ ‖g(w)‖+ 2(n−m) m(n− 1) × γ E‖ĝ(w)‖+ ‖g(w)‖ ≤ (n−m)γ m(n− 1)‖g(w)‖ .
Further, Var(‖ĝ(w)‖) = E‖ĝ(w)‖2 − (E‖ĝ(w)‖)2
≤ E‖ĝ(w)‖2 − ‖Eĝ(w)‖2
≤ ‖g(w)‖2 + 2(n−m) m(n− 1) γ − ‖g(w)‖2 = 2(n−m) m(n− 1) γ.

heading: B PROOFS FOR THEOREM 2
text: For proofs, Slutsky’s theorem and delta method are key results to describe limiting behaviors of random variables in distributional sense. Theorem B.1. (Slutsky’s theorem, Casella & Berger (2002)) Let {xn}, {yn} be a sequence of random variables that satisfies xn ⇒ x and yn
P→ ρ when n goes to infinity and ρ is constant. Then xnyn ⇒ cx
Theorem B.2. (Delta method, Casella & Berger (2002)) Let yn be a sequence of random variables that satisfies √ n(yn−µ)⇒ N (0, σ2). For a given smooth function f : R→ R, suppose that f ′(µ) exists and is not 0 where f ′ is a derivative. Then√ n× (f(yn)− f(µ))⇒ N (0, σ2(f ′(µ))2). Lemma B.1. Suppose that u and v are mutually independent d-dimensional uniformly random unit vectors. Then, √ d 〈u,v〉 ⇒ N (0, 1) as d→∞.
Proof. Note that d-dimensional uniformly random unit vectors u can be generated by normalization of d-dimensional multivariate standard normal random vectors x ∼ N(0, Id). That is,
u ∼ x ‖x‖ .
Suppose that two independent uniformly random unit vector u and v are generated by two independent d-dimensional standard normal vector x = (x1, x2, · · · , xd) and y = (y1, y2, · · · , yd). Denote them
u = x
‖x‖ and v =
y
‖y‖ .
By SLLN, we have ‖x‖√ d → 1 a.s.
(Use 1d ∑d i=1 x 2 i → Ex21 = 1). Since almost sure convergence implies convergence in probability, ‖x‖/ √ d P→ 1. Similarly, ‖y‖/ √ d P→ 1. Moreover, by CLT,
〈x,y〉√ d = √ d (1 d d∑ i=1 xiyi ) ⇒ N (0, 1).
Therefore, by Theorem B.1 (Slutsky’s theorem), √ d 〈u,v〉 ⇒ N (0, 1).
Theorem 2. Suppose that u and v are mutually independent d-dimensional uniformly random unit vectors. Then,
√ d× (180 π cos−1 〈u,v〉 − 90 ) ⇒ N ( 0, (180 π )2) as d→∞.
Proof. Suppose that µ = 0, σ = 1, and f(·) = 180π cos −1(·). Since 180π d dx cos −1(x) = − 180 π √ 1−x2 , we have f ′(µ) = − 180π . Hence, by Lemma B.1 and Theorem B.2 (Delta method), the desired convergence in distribution holds.

heading: C PROOFS FOR THEOREM 3

heading: C.1 PROOF OF LEMMA 1
text: Lemma 1. The approximated estimator of κ induced from the d-dimensional unit vectors {x1,x2, · · · ,xnb},
κ̂ = r̄(d− r̄2)
1− r̄2 ,
where r̄ = ‖ ∑nb
i=1 xi‖ nb
is a strict increasing function on [0, 1]. If we consider κ̂ = h(u) as function of u = ‖ ∑nb i=1 xi‖. Then h(·) is Lipschitz continuous on [0, nb(1 − )] for any > 0. Moreover, h(·) and h′(·) are strict increasing and increasing on [0, nb), respectively. Proof. Note that ‖ ∑nb i=1 xi‖ ≤ ∑nb i=1 ||xi|| = nb. Therefore, we have r̄ ∈ [0, 1]. If d = 1, then κ̂ = r̄ and this increases on [0, 1]. For d > 1,
dκ̂ dr̄ = d+ r̄4 + (d− 3r̄2)
(1− r̄2)2 and its numerator is always positive for d > 2. When d = 2,
dκ̂ dr̄ = r̄4 − 3r̄2 + 4 (1− r̄2)2 = (r̄2 − 32 ) 2 + 74 (1− r̄2)2 > 0.
So κ̂ increases as r̄ increases.
The Lipschitz continuity of h(·) directly comes from the continuity of dκ̂dr̄ since dκ̂
du =
1
nb
dκ̂ dr̄ .
Recall that any continuous function on the compact interval [0, nb(1 − )] is bounded. Hence the derivative of κ̂ with respect to u is bounded. This implies the Lipschitz continuity of h(·). h(·) is strictly increasing since r̄ = unb . Further,
h′′(u) = 1 nb2 d2κ̂ dr̄2
= 2r̄5 + (4− 8d)r̄3 + (8d− 6)r̄
nb2(1− r̄2)4 > 0
due to r̄ ∈ [0, 1]. Therefore h′(·) is also increasing on [0, nb).

heading: C.2 PROOF OF LEMMA 2
text: Lemma 2. Let p1,p2, · · · ,pnb be d-dimensional vectors. If all pi’s are not on a single ray from the current location w, then there exists positive number η such that∥∥∥ nb∑
j=1
pj −w − ∑nb i=1 pi−w ‖pi−w‖
‖pj −w − ∑nb i=1 pi−w ‖pi−w‖‖ ∥∥∥ < ∥∥∥ nb∑ i=1 pi −w ‖pi −w‖ ∥∥∥ for all ∈ (0, η].
Proof. Without loss of generality, we regard w as the origin. Let f( ) =∥∥∥∑nbj=1 pj− ∑nbi=1 pi‖pi‖‖pj− ∑nbi=1 pi‖pi‖‖ ∥∥∥2, then f(0) = ∥∥∥∑nbi=1 pi‖pi‖∥∥∥2. Therefore, we only need to show f ′(0) < 0. Now denote xj = pj ‖pj‖ , pj( ) = pj − ∑nb i=1 xi and u = − ∑nb i=1 xi. That is, pj( ) = pj + u. Since
f( ) = 〈 nb∑ j=1 pj( ) ‖pj( )‖ , nb∑ j=1 pj( ) ‖pj( )‖ 〉 ,
we have
f ′( ) = 2 〈 nb∑ j=1 pj( ) ‖pj( )‖ , d d ( nb∑ j=1 pj( ) ‖pj( )‖ )〉 and
d
d ( nb∑ j=1 pj( ) ‖pj( )‖ ) = nb∑ j=1 ‖pj( )‖u− 〈u,pj( )〉‖pj( )‖ pj( ) ‖pj( )‖2 .
Hence
f ′( ) = 2 〈 nb∑ j=1 pj( ) ‖pj( )‖ , nb∑ j=1 ‖pj( )‖u− 〈u,pj( )〉‖pj( )‖ pj( ) ‖pj( )‖2 〉 .
Note that pj(0) = pj and ‖xj‖ = 1. We have
f ′(0) = 2 〈 nb∑ j=1 pj ‖pj‖ , nb∑ j=1 ‖pj‖u− 〈u,pj〉‖pj‖ pj ‖pj‖2 〉 = 2 〈 nb∑ j=1 pj ‖pj‖ , nb∑ j=1 1 ‖pj‖ ( u− 〈 u, pj ‖pj‖ 〉 pj ‖pj‖
)〉 = 2 〈 nb∑ j=1 xj , nb∑ j=1 1 ‖pj‖ ( u− 〈u,xj〉xj
)〉 = 2 〈 − u,
nb∑ j=1 1 ‖pj‖ ( u− 〈u,xj〉xj )〉 = −2
nb∑ j=1 ‖u‖2 − 〈u,xj〉2 ‖pj‖
≤ −2 nb∑ j=1 ‖u‖2 − ‖u‖2‖xj‖2 ‖pj‖
= 0
Since the equality holds when 〈u,xj〉2 = ‖u‖2‖xj‖2 for all j, we have strict inequality when all pi’s are not located on a single ray from the origin.

heading: C.3 PROOF OF THEOREM 3
text: The proof of Theorem 3 is very similar to that of Lemma 2. Theorem 3. Let p1(w0t ),p2(w0t ), · · · ,pnb(w0t ) be d-dimensional vectors, and all pi(w0t )’s are not on a single ray from the current location w0t . If∥∥∥ nb∑
i=1
pi(w 0 t )−w0t
‖pi(w0t )−w0t ‖ − nb∑ i=1 ĝi(w i−1 t ) ‖ĝi(wi−1t )‖ ∥∥∥ ≤ ξ (6) for sufficiently small ξ > 0, then there exists positive number η such that∥∥∥ nb∑
j=1
pj(w 0 t )−w0t − ∑nb i=1 ĝi(w i−1 t )
‖ĝi(wi−1t )‖ ‖pj(w0t )−w0t − ∑nb i=1 ĝi(w i−1 t )
‖ĝi(wi−1t )‖ ‖
∥∥∥ < ∥∥∥ nb∑ i=1 pi(w 0 t )−w0t ‖pi(w0t )−w0t ‖ ∥∥∥ (7)
for all ∈ (0, η].
Proof. We regard w0t as the origin 0. For simplicity, write pi(0) and ĝi(w i−1 t ) as pi and ĝi, respectively. Let f( ) = ∥∥∥∑nbj=1 pj− ∑nbi=1 pi‖pi‖‖pj− ∑nbi=1 pi‖pi‖‖ ∥∥∥2 and f̃( ) = ∥∥∥∑nbj=1 pj− ∑nbi=1 ĝi‖ĝi|‖pj− ∑nbi=1 ĝi‖ĝi‖‖ ∥∥∥2.
Denote u = − ∑nb j=1 pi ‖pi‖ , t = ∑nb i=1 pi ‖pi‖ − ∑nb i=1 ĝi ‖ĝi‖ and p̃j( ) = pj + (u+ t). Then
f̃( ) = ∥∥∥ nb∑ i=1 p̃j( ) ‖p̃j( )‖ ∥∥∥2. Now we differentiate f̃( ) with respect to , that is,
f̃ ′( ) = 2 〈 nb∑ j=1 p̃j( ) ‖p̃j( )‖ , nb∑ j=1 ‖p̃j( )‖(u+ t)− 〈u+t,p̃j( )〉‖p̃j( )‖ p̃j( ) ‖p̃j( )‖2 〉 .
Recall that p̃j(0) = pj . Rewrite pj ‖pj‖ = xj and use f ′(0) in the proof of Lemma 2
f̃ ′(0) = 2 〈 nb∑ j=1 pj ‖pj‖ , nb∑ j=1 ‖pj‖(u+ t)− 〈u+t,pj〉‖pj‖ pj ‖pj‖2 〉
= 2 〈 − u, nb∑ j=1
u+ t− 〈 u+ t,
pj ‖pj‖ 〉 pj ‖pj‖
‖pj‖ 〉 = 2 〈 − u,
nb∑ j=1 1 ‖pj‖ ( u+ t− 〈u+ t,xj〉xj )〉 = 2 〈 − u,
nb∑ j=1 1 ‖pj‖ ( u− 〈u,xj〉xj )〉 + 2 〈 − u, nb∑ j=1 1 ‖pj‖ ( t− 〈t,xj〉xj )〉 = f ′(0)− 2
nb∑ j=1 1 ‖pj‖ ( 〈u, t〉 − 〈t,xj〉 〈u,xj〉 ) Since f ′(0) < 0 by the proof of Lemma 2,
f̃ ′(0) < 0 ⇐⇒ 2 nb∑ j=1 1 ‖pj‖ ( 〈t,xj〉 〈u,xj〉 − 〈u, t〉 ) < |f ′(0)|.
By using ‖xj‖ = 1 and applying the Cauchy inequality,
2 nb∑ j=1 1 ‖pj‖ ( 〈t,xj〉 〈u,xj〉 − 〈u, t〉 ) ≤ 2 nb∑ j=1 ‖t‖‖xj‖‖u‖‖xj‖+ ‖u‖‖t‖ ‖pj‖
= 4 nb∑ j=1 ‖u‖‖t‖ ‖pj‖
≤ 4nb‖u‖‖t‖ minj ‖pj‖
≤ 4n 2 bξ
minj ‖pj‖
( ∵ ‖u‖ ≤ nb∑ i=1 ‖xi‖ = nb ) .
Define r = minj ‖pj‖. If
ξ < |f ′(0)|r
4n2b ,
then f̃( ) < 0.

heading: D PROOFS FOR COROLLARY 3.1
text: Corollary 3.1. Let pi be local minibatch solutions for each fIi . Suppose a regionR satisfying:
For all w,w′ ∈ R, pi(w) = pi(w′) = pi for all i = 1, · · · , nb. Further, assume that Hessian matrices of fIi ’s are positive definite, wellconditioned, and bounded in the sense of matrix L2-norm on R. If SGD moves w0t to w0t+1 on R with a large batch size and a small learning rate, then κ̂(w0t ) > κ̂(w0t+1). Moreover, we can estimate κ̂(w0t ) and κ̂(w 0 t+1) by minibatch gradients at w 0 t and w 0 t+1, respectively.
Proof. Recall that w0t+1 = w 0 t + η ∑nb i=1 ĝi(w i−1 t ) where η is a learning rate. To prove Corollary 3.1, we need to show κ̂(w0t+1) < κ̂(w0t ) which is equivalent to∥∥∥ nb∑ j=1 pj(w 0 t+1)−w0t − η ∑nb i=1 ĝi(w i−1 t ) ‖pj(w0t+1)−w0t − η ∑nb i=1 ĝi(w i−1 t )‖ ∥∥∥ < ∥∥∥ nb∑ i=1 pi(w 0 t )−w0t ‖pi(w0t )−w0t ‖
∥∥∥. (8) Since ‖∇w2fIi(·)‖2 is bounded on R, ∇wfIi(·) is Lipschitz continuous on R(Bottou, 2010). If the batch size is sufficiently large and the learning rate η is sufficiently small, ‖ĝi(wi−1t )‖ ≈ ‖ĝi(w0t )‖ ≈ τ for all i by Theorem 1. Therefore, we have
η nb∑ i=1 ĝi(w i−1 t ) ≈ τη nb∑ i=1 ĝi(w i−1 t ) ‖ĝi(wi−1t )‖
If we denote τη as , we can convert (8) to (9).
∥∥∥ nb∑ j=1 pj(w 0 t+1)−w0t −
∑nb i=1 ĝi(w i−1 t )
‖ĝi(wi−1t )‖ ‖pj(w0t+1)−w0t − ∑nb i=1 ĝi(w i−1 t )
‖ĝi(wi−1t )‖ ‖
∥∥∥ < ∥∥∥ nb∑ i=1 pi(w 0 t )−w0t ‖pi(w0t )−w0t ‖ ∥∥∥. (9) Since bothw0t+1 andw 0 t are inR for small learning rate, we have pi(w0t+1) = pi(w0t ) = pi by the assumption. That is, (9) is equivalent to (7). In (7), ĝi(wi−1t )/‖ĝi(wi−1t )‖ cannot be replaced by (pi −w0t )/‖pi −w0t ‖ in general. Hence we introduce Definition D.1 and Lemma D.1 to connect the direction of the minibatch gradient with the corresponding local minibatch solution.
Definition D.1. The condition number c(A) of a matrixA is defined as
c(A) = σmax(A)
σmin(A)
where σmax(A) and σmin(A) are maximal and minimal singular values of A, respectively. If A is positive-definite matrix, then
c(A) = λmax(A)
λmin(A) .
Here λmax(A) and λmin(A) are maximal and minimal eigenvalues ofA, respectively.
Lemma D.1. If the condition number of the positive definite Hessian matrix of fIi at a local minibatch solution pi, denoted byHi = ∇w2fIi(pi), is close to 1 (well-conditioned), then the direction to pi from w is approximately parallel to its negative gradient at w. That is, for all w ∈ R,∥∥∥ pi −w‖pi −w‖ − ĝi(w)‖ĝi(w)‖
∥∥∥ ≈ 0 where ĝi(w) = −∇wfIi(w).
Proof. By the second order Taylor expansion,
fIi(w) ≈ fIi(pi) + 1
2 (w − pi)>Hi(w − pi).
Hence, ĝi(w) = −∇wfIi(w) ≈ −Hi(w − pi)
Denote pi −w as x. Then, we only need to show∥∥∥ x‖x‖ − Hix‖Hix‖ ∥∥∥2 ≈ 0
Since Hi is positive definite, we can diagonalize it as Hi = P>i ΛiPi where Pi is an orthonormal transition matrix forHi.∥∥∥ x‖x‖ − Hix‖Hix‖
∥∥∥2 = 2− 2 x>Hix‖x‖‖Hix‖ = 2− 2 (Pix) >ΛiPix
‖Pix‖‖P>i ΛiPix‖
= 2− 2 (Pix) >ΛiPix
‖Pix‖‖ΛiPx‖ ≤ 2− 2 ∑ j λj(Pix) 2 j
‖Pix‖‖ΛiPix‖
≤ 2− 2 λmin‖Pix‖ 2
‖Pix‖λmax‖Pix‖
= 2− 2 λmin λmax ≈ 0
Lemma D.1 suggests that a well-conditioned Hessian matrix of fIi at pi allows ĝi(w)/‖ĝi(w)‖ to be replaced by (pi −w)/‖pi −w‖ for all w ∈ R. Using this, we prove Lemma D.2.
Lemma D.2. Let w be a parameter in R. If the condition number of Hessian matrix of fIi is sufficiently close to 1 (well-conditioned) and ‖w−w 0 t ‖
‖pi−w0t ‖ is sufficiently close to 0, then∥∥∥ pi −w0t‖pi −w0t ‖ − ĝi(w)‖ĝi(w)‖ ∥∥∥ ≤ ξ nb
for all sufficiently small ξ.
Proof. We have∥∥∥ pi −w0t‖pi −w0t ‖ − ĝi(w)‖ĝi(w)‖ ∥∥∥ ≤ ∥∥∥ pi −w0t‖pi −w0t ‖ − g̃(w)‖g̃(w)‖ ∥∥∥+ ∥∥∥ g̃(w)‖g̃(w)‖ − ĝi(w)‖ĝi(w)‖ ∥∥∥
≤ ∥∥∥ pi −w0t‖pi −w0t ‖ − g̃(w)‖g̃(w)‖ ∥∥∥+ ∥∥∥ g̃(w)‖g̃(w)‖ − pi −w0t‖pi −w0t ‖ ∥∥∥
+ ∥∥∥ pi −w0t‖pi −w0t ‖ − pi −w‖pi −w‖ ∥∥∥+ ∥∥∥ pi −w‖pi −w‖ − ĝi(w)‖ĝi(w)‖ ∥∥∥
≤ + + √ 2 ( 1− 〈pi −w 0 t ,pi −w〉
‖pi −w0t ‖‖pi −w‖
) +
= 3 + √ 2 (
1− ‖pi −w 0 t ‖2 − 〈pi −w0t ,w −w0t 〉 ‖pi −w0t ‖‖pi −w‖ ) for sufficently small (See Lemma D.1). Now we only need to show√
2 (
1− ‖pi −w 0 t ‖2 − 〈pi −w0t ,w −w0t 〉 ‖pi −w0t ‖‖pi −w‖
) < . (10)
Since ‖w−w 0 t ‖
‖pi−w0t ‖ is sufficiently small, we have
‖pi −w0t ‖2 − 〈 pi −w0t ,w −w0t 〉 = ‖pi −w0t ‖ ( ‖pi −w0t ‖ − 〈 pi −w0t ‖pi −w0t ‖ ,w −w0t 〉)
≥ ‖pi −w0t ‖(‖pi −w0t ‖ − ‖w −w0t ‖) = ‖pi −w0t ‖2 ( 1− ‖w −w 0 t ‖
‖pi −w0t ‖ ) ≥ 0.
By using the above non-negativeness, we have the following inequality.
1 ≥ ‖pi −w0t ‖2 −
〈 pi −w0t ,w −w0t 〉 ‖pi −w0t ‖‖pi −w‖
≥ ‖pi −w0t ‖2 −
〈 pi −w0t ,w −w0t 〉 ‖pi −w0t ‖(‖pi −w0t ‖+ ‖w −w0t ‖)
=
‖pi−w0t ‖ ‖w−w0t ‖ − 〈 pi−w0t ‖pi−w0t ‖ , w−w0t ‖w−w0t ‖ 〉 1 +
‖pi−w0t ‖ ‖w−w0t ‖
≥ ‖pi−w0t ‖ ‖w−w0t ‖ − 1
1 + ‖pi−w0t ‖ ‖w−w0t ‖
. (11)
As ‖w−w 0 t ‖
‖pi−w0t ‖ → 0+, (11) is monotonically increasing to 1. This implies that (10) holds for suffi-
ciently small .
With a small learning rate,wi−1t ’s are inR for all i ∈ {1, . . . , nb}. As a result, by Lemma D.2, we have ∥∥∥ pi −w0t‖pi −w0t ‖ − ĝi(w i−1 t ) ‖ĝi(wi−1t )‖ ∥∥∥ ≤ ξ nb (12) for sufficiently small ξ. This implies (6) since∥∥∥ nb∑ i=1 pi −w ‖pi −w‖ − nb∑ i=1 ĝi(w i−1 t ) ‖ĝi(wi−1t )‖ ∥∥∥ ≤ nb∑ i=1 ∥∥∥ pi −w‖pi −w‖ − ĝi(w i−1 t ) ‖ĝi(wi−1t )‖
∥∥∥. Then we can apply Theorem 3 and κ̂(w0t ) > κ̂(w0t+1) holds.
For the last statement, ”Moreover, we can estimate κ̂(w0t ) and κ̂(w 0 t+1) by minibatch gradients at w0t and w 0 t+1, respectively.”, recall that
κ̂(w0t ) = h (∥∥∥ nb∑
i=1
pi(w 0 t )−w0t
‖pi(w0t )−w0t ‖ ∥∥∥) where h(·) is increasing and Lipschitz continuous(Lemma 1). By Lemma D.1, we have∥∥∥ pi(w0t )−w0t‖pi(w0t )−w0t ‖ − ĝi(w 0 t ) ‖ĝi(w0t )‖ ∥∥∥ < ξ nb for sufficiently small ξ > 0. Therefore,∣∣∣∥∥∥ nb∑ i=1 pi(w 0 t )−w0t ‖pi(w0t )−w0t ‖ ∥∥∥− ∥∥∥ nb∑ i=1 ĝi(w 0 t ) ‖ĝi(w0t )‖ ∥∥∥∣∣∣ ≤ ∥∥∥ nb∑ i=1 pi(w 0 t )−w0t ‖pi(w0t )−w0t ‖ − nb∑ i=1 ĝi(w 0 t ) ‖ĝi(w0t )‖
∥∥∥ where rhs is bounded by ξ. Hence, Lipschitz continuity of h(·) implies that∣∣∣h(∥∥∥ nb∑
i=1
pi(w 0 t )−w0t
‖pi(w0t )−w0t ‖ ∥∥∥)− h(∥∥∥ nb∑ i=1 ĝi(w 0 t ) ‖ĝi(w0t )‖ ∥∥∥)∣∣∣→ 0 as ξ → 0. That is,
κ̂(w0t ) ≈ h (∥∥∥ nb∑
i=1
ĝi(w 0 t )
‖ĝi(w0t )‖ ∥∥∥)). Since t is arbitrary, we can apply this for all w ∈ R including w0t+1.

heading: E EXPERIMENTAL DETAILS

heading: E.1 MODEL ARCHITECTURE
text: For all cases, their weighted layers do not have biases, and dropout (Srivastava et al., 2014) is not applied. We use Xavier initializations(Glorot & Bengio, 2010) and cross entropy loss functions for all experiments.
FNN The FNN is a fully connected network with a single hidden layer. It has 800 hidden units with ReLU (Nair & Hinton, 2010) activations and a softmax output layer.
DFNN The DFNN is a fully connected network with three hidden layers. It has 800 hidden units with ReLU activations in each hidden layers and a softmax output layer.
CNN The network architecture of CNN is similar to the network introduced in He et al. (2016) as a CIFAR-10 plain network. The first layer is 3 × 3 convolution layer and the number of output filters are 16. After that, we stack of {4, 4, 3, 1} layers with 3× 3 convolutions on the feature maps of sizes {32, 16, 8, 4} and the numbers of filters {16, 32, 64, 128}, respectively. The subsampling is performed with a stride of 2. All convolution layers are activated by ReLU and the convolution part ends with a global average pooling(Lin et al., 2013), a 10-way fully-conneted layers, and softmax. Note that there are 14 stacked weighted layers.
+BN We apply batch normalization right before the ReLU activations on all hidden layers.
+Res The identity skip connections are added after every two convolution layers before ReLU nonlinearity (After batch normalization, if it is applied on it.). We concatenate zero padding slices backwards when the number of filters increases.

heading: E.2 DATA
text: We use neither data augmentations nor preprocessings except scaling pixel values into [0, 1] both MNIST and CIFAR-10. In the case of CIFAR-10, for validation, we randomly choose 5000 images out of 50000 training images.
F SOME NOTES ABOUT THE κ ESTIMATE
We point out that, for a small κ, the absolute value of κ̂ is not a precise indicator of the uniformity due to its dependence on the dimensionality, as was investigated earlier by Cutting et al. (2017). In order to verify this claim, we run some simulations. First, we vary the number of samples and the true underlying κ with the fixed dimensionality (Unfortunately, we could not easily go over 10, 000 dimensions due to the difficulty in sampling from the vMF distribution with positive κ.). We draw {1, 000, 2, 000, 3, 000} random samples from the vMF distribution with the designated κ. We compute κ̂ from these samples.
As can be seen from Figure 8, the κ̂ approaches the true κ from above as the number of samples increases. When the true κ is large, the estimation error rapidly becomes zero as the number of samples approaches 3, 000. When the true κ is low, however, the gap does not narrow completely even with 3, 000 samples.
While fixing the true κ to 0 and the number of samples to {1, 000, 2, 000, 3, 000}, we vary the dimensionality to empirically investigate the κ̂. We choose to use 3, 000 samples to be consistent with our experiments in this paper. We run five simulations each and report both mean and standard deviation (Table 1).
We clearly observe the trend of increasing κ̂’s with respect to the dimensions. This suggests that we should not compare the absolute values of κ̂’s across different network architectures due to the differences in the number of parameters. This agrees well with Cutting et al. (2017) which empirically showed that the threshold for rejecting the null hypothesis of κ = p by using κ̂ where p is a fixed value grows with respect to the dimensions.

heading: G OTHER FOUR TRAINING RUNS IN FIGURE 7
text: We show plots from other four training runs in Figure 6. For all runs, the curves of GS (inverse of SNR) and κ̂ are strongly correlated while GNS (inverse of normSNR) is less correlated to GS.

Review summaries:
Gradient stochasticity is used to analyse the learning dynamics of SGD. It consists of two aspects: norm stochasticity and directional stochasticity. Although the norm stochasticity is easy to compute, it vanishes when the batch size increases. Therefore, it can be hard to measure the learning dynamics of SGD. The paper is motivated by measuring the learning dynamics by the directional stochasticity. Directly measuring the directional stochasticity with the ange distribution is hard, so the paper uses vMF distribution to approximate the uniformity measurement. The paper theoretically studies the proposed directional uniformity measurement. In addition, the experiments empirically show the directional uniformity measurement is more coherent with the gradient stochasticity.

This work provides an analysis of the directional distribution of of stochastic gradients in SGD. The basic claim is that the distribution, when modeled as a von Mises-Fisher distribution, becomes more uniform as training progresses. There is experimental verification of this claim, and some results suggesting that the SNR is more correlated with their measure of uniformity than with the norm of the gradients.