Deep Residual Networks present a premium in performance in comparison to conventional networks of the same depth and are trainable at extreme depths. It has recently been shown that Residual Networks behave like ensembles of relatively shallow networks. We show that these ensembles are dynamic: while initially the virtual ensemble is mostly at depths lower than half the network’s depth, as training progresses, it becomes deeper and deeper. The main mechanism that controls the dynamic ensemble behavior is the scaling introduced, e.g., by the Batch Normalization technique. We explain this behavior and demonstrate the driving force behind it. As a main tool in our analysis, we employ generalized spin glass models, which we also use in order to study the number of critical points in the optimization of Residual Networks.
1 INTRODUCTION
Residual Networks (He et al., 2015) (ResNets) are neural networks with skip connections. These networks, which are a specific case of Highway Networks (Srivastava et al., 2015), present state of the art results in the most competitive computer vision tasks including image classification and object detection.
The success of residual networks was attributed to the ability to train very deep networks when employing skip connections (He et al., 2016). A complementary view is presented by Veit et al. (2016), who attribute it to the power of ensembles and present an unraveled view of ResNets that depicts ResNets as an ensemble of networks that share weights, with a binomial depth distribution around half depth. They also present experimental evidence that short paths of lengths shorter than half-depth dominate the ResNet gradient during training.
The analysis presented here shows that ResNets are ensembles with a dynamic depth behavior. When starting the training process, the ensemble is dominated by shallow networks, with depths lower than half-depth. As training progresses, the effective depth of the ensemble increases. This increase in depth allows the ResNet to increase its effective capacity as the network becomes more and more accurate.
Our analysis reveals the mechanism for this dynamic behavior and explains the driving force behind it. This mechanism remarkably takes place within the parameters of Batch Normalization (Ioffe & Szegedy, 2015), which is mostly considered as a normalization and a fine-grained whitening mechanism that addresses the problem of internal covariate shift and allows for faster learning rates.
We show that the scaling introduced by batch normalization determines the depth distribution in the virtual ensemble of the ResNet. These scales dynamically grow as training progresses, shifting the effective ensemble distribution to bigger depths.
The main tool we employ in our analysis is spin glass models. Choromanska et al. (2015a) have created a link between conventional networks and such models, which leads to a comprehensive study of the critical points of neural networks based on the spin glass analysis of Auffinger et al. (2013). In our work, we generalize these results and link ResNets to generalized spin glass models. These models allow us to analyze the dynamic behavior presented above. Finally, we apply the results of Auffinger & Arous (2013) in order to study the loss surface of ResNets.
2 A RECAP OF CHOROMANSKA ET AL. (2015A)
We briefly summarize Choromanska et al. (2015a), which connects the loss function of multilayer networks with the hamiltonian of the p spherical spin glass model, and state their main contributions and results. The notations of our paper are summarized in Appendix A and slightly differ from those in Choromanska et al. (2015a).
A simple feed forward fully connected network N , with p layers and a single output unit is considered. Let ni be the number of units in layer i, such that n0 is the dimension of the input, and np = 1. It is further assumed that the ReLU activation functions denoted by R() are used. The output Y of the network given an input vector x ∈ Rd can be expressed as
Y = d∑ i=1 γ∑ j=1 xijAij p∏ k=1 w (k) ij , (1)
where the first summation is over the network inputs x1...xd, and the second is over all paths from input to output. There are γ = ∏p i=1 ni such paths and ∀i, xi1 = xi2 = ...xiγ . The variable Aij ∈ {0, 1} denotes whether the path is active, i.e., whether all of the ReLU units along this path are producing positive activations, and the product ∏p k=1 w (k) ij represents the specific weight configurationw1ij ...w k ij multiplying xi given path j. It is assumed throughout the paper that the input variables are sampled i.i.d from a normal Gaussian distribution.
Definition 1. The mass of the network N is defined as ψ = ∏p i=0 ni.
The variablesAij are modeled as independent Bernoulli random variables with a success probability ρ, i.e., each path is equally likely to be active. Therefore,
EA[Y ] = d∑ i=1 γ∑ j=1 xijρ p∏ k=1 w (k) ij . (2)
The task of binary classification using the networkN with parameters w is considered, using either the hinge loss LhN or the absolute loss LaN :
LhN (w) = EA[max(0, 1− YxY )], LaN (w) = EA[|Yx − Y |] (3)
where Yx is a random variable corresponding to the true label of sample x. In order to equate either loss with the hamiltonian of the p-spherical spin glass model, a few key approximations are made:
A1 Variable independence - The inputs xij are modeled as independent normal Gaussian random variables.
A2 Redundancy in network parameterization - It is assumed the set of all the network weights [w1, w2...wN ] contains only Λ unique weights such that Λ < N .
A3 Uniformity - It is assumed that all unique weights are close to being evenly distributed on the graph of connections defining the network N . Practically, this means that we assume every node is adjacent to an edge with any one of the Λ unique weights.
A4 Spherical constraint - The following is assumed:
1
Λ Λ∑ i=1 w2i = C 2 (4)
for some constant C > 0.
These assumptions are made for the sake of analysis, and do not necessarily hold. The validity of these assumption was posed as an open problem in Choromanska et al. (2015b), where a different degree of plausibility was assigned to each. Specifically, A1, as well as the independence assumption of Aij , were deemed unrealistic, and A2 - A4 as plausible. For example, A1 does not hold since each input xi is associated with many different paths and xi1 = xi2 = ...xiγ . See Choromanska et al. (2015a) for further justification of these approximations.
Under A1–A4, the loss takes the form of a centered Gaussian process on the sphere SΛ−1( √
Λ). Specifically, it is shown to resemble the hamiltonian of the a spherical p-spin glass model given by:
Hp,Λ(w̃) = 1
Λ p−1 2 Λ∑ i1...ip xi1...ip r∏ k=1 w̃ik (5)
with spherical constraint 1
Λ Λ∑ i=1 w̃2i = 1 (6)
where xi1...ip are independent normal Gaussian variables.
In Auffinger et al. (2013), the asymptotic complexity of spherical p spin glass model is analyzed based on random matrix theory. In Choromanska et al. (2015a) these results are used in order to shed light on the optimization process of neural networks. For example, the asymptotic complexity of spherical spin glasses reveals a layered structure of low-index critical points near the global optimum. These findings are then given as a possible explanation to several central phenomena found in neural networks optimization, such as similar performance of large nets, and the improbability of getting stuck in a “bad” local minima.
As part of our work, we follow a similar path. First, a link is formed between residual networks and the hamiltonian of a general multi-interaction spherical spin glass model as given by:
Hp,Λ(w̃) = p∑ r=1 r Λ r−1 2 Λ∑ i1,i2...ir=1 xi1,i2...ir r∏ k=1 w̃ik (7)
where 1... p are positive constants. Then, using Auffinger & Arous (2013), we obtain insights on residual networks. The other part of our work studies the dynamic behavior of residual networks, where we relax the assumptions made for the spin glass model.
3 RESIDUAL NETS AND GENERAL SPIN GLASS MODELS
We begin by establishing a connection between the loss function of deep residual networks and the hamiltonian of the general spherical spin glass model. We consider a simple feed forward fully connected network N , with ReLU activation functions and residual connections. For simplicity of notations without the loss of generality, we assume n1 = ... = np = n. n0 = d as before. In our ResNet model, there exist p− 1 identity connections skipping a single layer each, starting from the first hidden layer. The output of layer l > 1 is given by:
Nl(x) = R(W>l Nl−1(x)) +Nl−1(x) (8) where Wl denotes the weight matrix connecting layer l− 1 with layer l. Notice that the first hidden layer has no parallel skip connection, and so N1(x) = R(W>1 x). Without loss of generality, the scalar output of the network is the sum of the outputs of the output layer p and is expressed as
Y = p∑ r=1 d∑ i=1 γr∑ j=1 x (r) ij A (r) ij r∏ k=1 w (r)(k) ij (9)
where A(r)ij ∈ {0, 1} denotes whether path j of length r is open, and ∀j, j′, r, r′ xrij = xr ′
ij′ . The residual connections in N imply that the output Y is now the sum of products of different lengths, indexed by r. Since our ResNet model attaches a skip connection to every layer except the first, 1 ≤ r ≤ p. See Sec. 6 regarding models with less frequent skip connections. Each path of length r includes r − 1 non-skip connections (those involving the first term in Eq. 8 and not the second, identity term) out of layers l = 2..p. Therefore, γr = ( p−1 r−1 ) nr. We define the following measure on the network: Definition 2. The mass of a depth r subnetwork in N is defined as ψr = dγr.
The properties of redundancy in network parameters and their uniform distribution, as described in Sec. 2, allow us to re-index Eq. 9.
Lemma 1. Assuming assumptions A2 − A4 hold, and nΛ ∈ Z, then the output can be expressed after reindexing as:
Y = p∑ r=1 Λ∑ i1,i2...ir=1 ψr Λr∑ j=1 x (j) i1,i2...ir A (j) i1,i2...ir r∏ k=1 wik . (10)
All proofs can be found in Appendix B.
Making the modeling assumption that the ReLU gates are independent Bernoulli random variables with probability ρ, we obtain that for every path of length r, EA(j)i1,i2...ir = ρ r and
EA[Y ] = p∑ r=1 Λ∑ i1,i2...ir=1 ψr Λr∑ j=1 x (j) i1,i2...ir ρr r∏ k=1 wik . (11)
In order to connect ResNets to generalized spherical spin glass models, we denote the variables:
ξi1,i2...ir = ψr Λr∑ j=1 xji1,i2...ir , x̃i1,i2...ir = ξi1,i2...ir Ex[ξ2i1,i2...ir ] 1 2
(12)
Note that since the input variables x1...xd are sampled from a centered Gaussian distribution (dependent or not), then the set of variables x̃i1,i2...ir are dependent normal Gaussian variables. Lemma 2. Assuming A2−A3 hold, and nΛ ∈ N then ∀r,i1...ir the following holds:
1 d ( ψr Λr )2 ≤ E[ξ2i1,i2...ir ] ≤ ( ψr Λr )2. (13)
We approximate the expected output EA(Y ) with Ŷ by assuming the minimal value in 13 holds such that ∀r,i1...ir E[ξ2i1,i2...ir ] = 1 d ( ψr Λr )
2. This approximation holds exactly when Λ = n, since all weight configurations of a particular length in Eq. 10 will appear the same number of times. When Λ 6= n, the uniformity assumption dictates that each configuration of weights would appear approximately equally regardless of the inputs, and the expectation values would be very close to the lower bound. The following expression for Ŷ is thus obtained:
Ŷ = p∑ r=1 ( ρ Λ )r ψr√ d Λ∑ i1,i2...ir=1 x̃i1,i2...ir r∏ k=1 wik . (14)
The independence assumption A1 was not assumed yet, and 14 holds regardless. Assuming A4 and denoting the scaled weights w̃i = 1Cwi, we can link the distribution of Ŷ to the distribution on x̃:
Ŷ = p∑ r=1 ψr√ d ( ρC Λ )r Λ∑ i1,i2...ir=1 x̃i1,i2...ir r∏ k=1 w̃ik
= z p∑ r=2 r Λ r−1 2 Λ∑ i1,i2...ir=1 x̃i1,i2...ir r∏ k=1 w̃ik (15)
where r = r = 1z ( p−1 r−1 ) (ρnC√ Λ )r and z is a normalization factor such that ∑p r=1 2 r = 1.
The following lemma gives a generalized expression for the binary and hinge losses of the network.
Lemma 3 ( Choromanska et al. (2015a)). Assuming assumptions A2 − A4 hold, then both the losses LhN (x) and LaN (x) can be generalized to a distribution of the form:
LN (x) = C1 + C2Ŷ (16)
where C1, C2 are positive constants that do not affect the optimization process.
The model in Eq. 16 has the form of a spin glass model, except for the dependency between the variables x̃i1,i2...ir . We later use an assumption similar to A1 of independence between these variables in order to link the two binary classification losses and the general spherical spin glass model. However, for the results in this section, this is not necessary.
We denote the important quantities:
β = ρnC√
Λ , r =
1
z ( p− 1 r − 1 ) βr (17)
The series ( r) p r=1 determines the weight of interactions of a specific length in the loss surface. Notice that for constant depth p and large enough β, arg maxr( r) = p. Therefore, for wide networks, where n and, therefore, β are large, interactions of order p dominate the loss surface, and the effect of the residual connections diminishes. Conversely, for constant β and a large enough p (deep networks), we have that arg maxr( r) < p, and can expect interactions of order r < p to dominate the loss. The asymptotic behavior of is captured by the following lemma:
Theorem 1. Assuming β1+β p ∈ N, we have that:
lim p→∞
1 p arg max r ( r) = β 1 + β (18)
As the next theorem shows, the epsilons are concentrated in a narrow band near the maximal value.
Theorem 2. For any α1 < β1+β < α2, and assuming α1p, α2p, β 1+β p ∈ N, it holds that:
lim p→∞ α2p∑ r=α1p 2r = 1 (19)
Thm. 2 implies that for deep residual networks, the contribution of weight products of order far away from the maximum β1+β p is negligible. The loss is, therefor, similar in complexity to that of an ensemble of potentially shallow conventional nets. The next Lemma shows that we can shift the effective depth to any value by simply controlling C.
Lemma 4. For any integer 1 ≤ k ≤ p there exists a global scaling parameter C such that arg maxr( r(C)) = k.
A simple global scaling of the weights is, therefore, enough to change the loss surface, from an ensemble of shallow conventional nets, to an ensemble of deep nets. This is illustrated in Fig. 1(a-c) for various values of β. In a common weight initialization scheme for neural networks,C = 1√
n (Orr
& Müller, 2003; Glorot & Bengio, 2010). With this initialization and Λ = n, β = ρ and the maximal weight is obtained at less than half the network’s depth limp→∞ arg maxr( r) < p 2 . Therefore, at the initialization, the loss function is primarily influenced by interactions of considerably lower order than the depth p, which facilitates easier optimization.
4 DYNAMIC BEHAVIOR OF RESIDUAL NETS
The expression for the output of a residual net in Eq. 15 provides valuable insights into the machinery at work when optimizing such models. Thm. 1 and 2 imply that the loss surface resembles that of an ensemble of shallow nets (although not a real ensemble due to obvious dependencies), with various depths concentrated in a narrow band. As noticed in Veit et al. (2016), viewing ResNets as ensembles of relatively shallow networks helps in explaining some of the apparent advantages of these models, particularly the apparent ease of optimization of extremely deep models, since deep paths barely affect the overall loss of the network. However, this alone does not explain the increase in accuracy of deep residual nets over actual ensembles of standard networks. In order to explain the improved performance of ResNets, we make the following claims:
1. The distribution of the depths of the networks within the ensemble is controlled by the scaling parameter C.
2. During training, C changes and causes a shift of focus from a shallow ensemble to deeper and deeper ensembles, which leads to an additional capacity.
3. In networks that employ batch normalization, C is directly embodied as the scale parameter λ. The starting condition of λ = 1 offers a good starting condition that involves extremely shallow nets.
For the remainder of Sec.4, we relax all assumptions, and assume that at some point in time 1 Λ ∑Λ i=1 w 2 i = C
2, and Λ = N . Using Eq. 9 for the output of the network Ŷ in Lemma. 3, the loss can be expressed:
LN (x,w) = C1 + C2 p∑ r=1 d∑ i=1 γr∑ j=1 x (r) ij A (r) ij r∏ k=1 w (r)(k) ij (20)
where C1, C2 are some constants that do not affect the optimization process. In order to gain additional insight into this dynamic mechanism, we investigate the derivative of the loss with respect to the scale parameter C. Using Eq. 9 for the output, we obtain:
∂LN (x,w) ∂C = C2 C p∑ r=1 r d∑ i=1 γr∑ j=1 x (r) ij A (r) ij r∏ k=1 w (r)(k) ij (21)
Notice that the addition of a multiplier r indicates that the derivative is increasingly influenced by deeper networks.
4.1 BATCH NORMALIZATION
Batch normalization has shown to be a crucial factor in the successful training of deep residual networks. As we will show, batch normalization layers offer an easy starting condition for the network, such that the gradients from early in the training process will originate from extremely shallow paths.
We consider a simple batch normalization procedure, which ignores the additive terms, has the output of each ReLU unit in layer l normalized by a factor σl and then is multiplied by some parameter λl. The output of layer l > 1 is therefore:
Nl(x) = λl σl R(W>l Nl−1(x)) +Nl−1(x) (22)
where σl is the mean of the estimated standard deviations of various elements in the vector R(W>l Nl−1(x)). Furthermore, a typical initialization of batch normalization parameters is to set ∀l, λl = 1. In this case, providing that units in the same layer have equal variance σl, the recursive relation E[Nl+1(x)2j ] = 1 + E[Nl(x)2j ] holds for any unit j in layer l. This, in turn, implies that the output of the ReLU units should have increasing variance σ2l as a function of depth. Multiplying the weight parameters in deep layers with an increasingly small scaling factor 1σl , effectively reduces the influence of deeper paths, so that extremely short paths will dominate the early stages of optimization. We next analyze how the weight scaling, as introduced by batch normalization, provides a driving force for the effective ensemble to become deeper as training progresses.
4.2 THE DRIVING FORCE BEHIND THE SCALE INCREASE
The analysis below focuses on a single residual connection skipping a block of one or more layers. Since it holds for each block individually, it holds also for a residual network of multiple skipped blocks of arbitrary depth.
We consider a simple network of depth p, with a single residual connection skipping p −m layers. We further assume that batch normalization is applied at the output of each ReLU unit as described in Eq. 22. We denote by l1...lm the indices of layers that are not skipped by the residual connection, and λ̂m = ∏m i=1
λli σli
, λ̂p = ∏p i=1 λi σi . Since every path of length m is multiplied by λ̂m, and every
path of length p is multiplied by λ̂p, the expression for the loss can be expressed using Eq. 20 and
ignoring constant terms:
LN (x,w) = λ̂m d∑ i=1 γm∑ j=1 x (m) ij A (m) ij r∏ k=1 w (m)(k) ij + λ̂p d∑ i=1 γp∑ j=1 x (m) ij A (p) ij p∏ k=1 w (p)(k) ij
= Lm(x,w) + Lp(x,w) (23)
We denote by ∇w the derivative operator with respect to the parameters w, and the gradient g = ∇wLN (x,w) = gm + gp evaluated at point w.
Theorem 3. Considering the loss in 23, and assuming ∂LN (x,w)∂λl = 0, then for a small learning rate 0 < µ << 1 the following hold:
1. For any λl∈l1...lm then: ∣∣∣∣λl − µ∂LN (x,w − µg)∂λl ∣∣∣∣ > |λl| (24)
2. For any λl 6∈l1...lm , if ‖gp‖22 + g>p gm > 0 then:∣∣∣∣λl − µ∂LN (x,w − µg)∂λl ∣∣∣∣ > |λl| (25)
Thm. 3 suggests that |λl| will increase for layers l that do not have skip-connections. Conversely, if layer l has a parallel skip connection, then |λl| will increase if ‖gp‖2 > ‖gm‖2, where the later condition implies that shallow paths are nearing a local minima. Notice that an increase in |λl 6∈l1...lm | results in an increase in |λ̃p|, while |λ̃m| remains unchanged, therefore shifting the balance into deeper ensembles.
This steady increase of |λl|, as predicted in our theoretical analysis, is also backed in experimental results, as depicted in Fig. 1(d). Note that the first layer, which cannot be skipped, behaves differently than the other layers. More experiments can be found in Appendix C.
It is worth noting that the mechanism for this dynamic property of residual networks can also be observed without the use of batch normalization, as a steady increase in the L2 norm of the weights, as shown in Fig. 1(e). In order to model this, consider the residual network as discussed above, without batch normalization layers. Recalling, ‖w‖2 = C √ Λ, w̃ = wC , the loss of this network is expressed as:
LN (x,w) = Cm d∑ i=1 γm∑ j=1 x (m) ij A (m) ij r∏ k=1 w̃ (m)(k) ij + C p d∑ i=1 γp∑ j=1 x (m) ij A (p) ij p∏ k=1 w̃ (p)(k) ij
= Lm(x,w) + Lp(x,w) (26)
Theorem 4. Considering the loss in 26, and assuming ∂LN (x,w)∂C = 0, then for a small learning rate 0 < µ << 1 the following hold:
∂LN (x,w − µg) ∂C ≈ −µ 1 C (m‖gm‖22 + p‖gp‖22 + (m+ p)g>p gm) (27)
Thm. 4 indicates that if either ‖gp‖2 or ‖gm‖2 is dominant (for example, near local minimas of the shallow network, or at the start of training), the scaling of the weights C will increase. This expansion will, in turn, emphasize the contribution of deeper paths over shallow paths, and increase the overall capacity of the residual network. This dynamic behavior of the effective depth of residual networks is of key importance in understanding the effectiveness of these models. While optimization starts off rather easily with gradients largely originating from shallow paths, the overall advantage of depth is still maintained by the dynamic increase of the effective depth.
5 THE LOSS SURFACE OF ENSEMBLES
We now present the results of Auffinger & Arous (2013) regarding the asymptotic complexity in the case of limΛ→∞ of the multi-spherical spin glass model given by:
H ,Λ = − ∞∑ r=2 r Λ r−1 2 Λ∑ i1,...ir=1 Jri1...ir w̃i2 ...w̃ir (28)
where Jri1...ir are independent centered standard Gaussian variables, and = ( r)r>2 are positive real numbers such that ∑∞ r=2 r2
r < ∞. A configuration w of the spin spherical spin-glass model is a vector in RΛ satisfying the spherical constraint:
1
Λ Λ∑ i=1 w2i = 1, ∞∑ r=2 2r = 1 (29)
Note that the variance of the process is independent of :
E[H2 ,Λ] = ∞∑ r=2 Λ1−r 2r( Λ∑ i=1 w2i ) r = Λ ∞∑ r=1 2r = Λ (30)
Definition 3. We define the following:
v′ = ∞∑ r=2 2rr, v ′′ = ∞∑ r=2 2rr(r − 1), α2 = v′′ + v′ − v′2 (31)
Note that for the single interaction spherical spin model α2 = 0. The index of a critical point of H ,Λ is defined as the number of negative eigenvalues in the hessian∇2H ,Λ evaluated at the critical point w. Definition 4. For any 0 ≤ k < Λ and u ∈ R, we denote the random number Crtλ,k(u, ) as the number of critical points of the hamiltonian in the set BX = {ΛX|X ∈ (−∞, u)} with index k. That is:
CrtΛ,k(u, ) = ∑
w:∇H ,Λ=0 1 {H ,Λ ∈ Λu}1
{ i(∇2H ,Λ) = k } (32)
Furthermore, define θk(u, ) = limΛ→∞ 1Λ log E[CrtΛ,k(u )]. Corollary 1.1 of Auffinger & Arous (2013) states that for any k > 0:
θk(R, ) = 1
2 log(
v′′
v′ )− v
′′ − v′
v′′ + v′ (33)
Eq. 33 provides the asymptotic mean total number of critical points with non-diverging index k. It is presumed that the SGD algorithm will easily avoid critical points with a high index that have many descent directions, and maneuver towards low index critical points. We, therefore, investigate how the mean total number of low index critical points vary as the ensemble distribution embodied in ( r)r>2 changes its shape by a steady increase in β.
Fig. 1(f) shows that as the ensemble progresses towards deeper networks, the mean amount of low index critical points increases, which might cause the SGD optimizer to get stuck in local minima. This is, however, resolved by the the fact that by the time the ensemble becomes deep enough, the loss function has already reached a point of low energy as shallower ensembles were more dominant earlier in the training. In the following theorem, we assume a finite ensemble such that∑∞ r=p+1 r2
r ≈ 0. Theorem 5. For any k ∈ N, p > 1, we denote the solution to the following constrained optimization problems:
∗ = arg max θk(R, ) s.t p∑ r=2 2r = 1 (34)
It holds that:
∗r =
{ 1, r = p
0, otherwise (35)
Thm. 5 implies that any heterogeneous mixture of spin glasses contains fewer critical points of a finite index, than a mixture in which only p interactions are considered. Therefore, for any distribution of that is attainable during the training of a ResNet of depth p, the number of critical points is lower than the number of critical points for a conventional network of depth p.
6 DISCUSSION
In this work, we use spin glass analysis in order to understand the dynamic behavior ResNets display during training and to study their loss surface. In particular, we use at one point or another the assumptions of redundancy in network parameters, near uniform distribution of network weights, independence between the inputs and the paths and independence between the different copies of the input as described in Choromanska et al. (2015a). The last two assumptions, i.e., the two independence assumptions, are deemed in Choromanska et al. (2015b) as unrealistic, while the remaining are considered plausible.
Our analysis of critical points in ensembles (Sec. 5) requires all of the above assumptions. However, Thm. 1 and 2, as well as Lemma. 4, do not assume the last assumption, i.e., the independence between the different copies of the input. Moreover, the analysis of the dynamic behavior of residual nets (Sec. 4) does not assume any of the above assumptions.
Our results are well aligned with some of the results shown in Larsson et al. (2016), where it is noted empirically that the deepest column trains last. This is reminiscent of our claim that the deeper networks of the ensemble become more prominent as training progresses. The authors of Larsson et al. (2016) hypothesize that this is a result of the shallower columns being stabilized at a certain point of the training process. In our work, we discover the exact driving force that comes into play.
In addition, our work offers an insight into the mechanics of the recently proposed densely connected networks (Huang et al., 2016). Following the analysis we provide in Sec. 3, the additional shortcut paths decrease the initial capacity of the network by offering many more short paths from input to output, thereby contributing to the ease of optimization when training starts. The driving force mechanism described in Sec. 4.2 will then cause the effective capacity of the network to increase.
Note that the analysis presented in Sec. 3 can be generalized to architectures with arbitrary skip connections, including dense nets. This is done directly by including all of the induced sub networks in Eq. 9. The reformulation of Eq. 10 would still holds, given that Ψr is modified accordingly.
7 CONCLUSION
Ensembles are a powerful model for ResNets, which unravels some of the key questions that have surrounded ResNets since their introduction. Here, we show that ResNets display a dynamic ensemble behavior, which explains the ease of training such networks even at very large depths, while still maintaining the advantage of depth. As far as we know, the dynamic behavior of the effective capacity is unlike anything documented in the deep learning literature. Surprisingly, the dynamic mechanism typically takes place within the outer multiplicative factor of the batch normalization module.
A SUMMARY OF NOTATIONS
Table 1 presents the various symbols used throughout this work and their meaning.
B PROOFS
Proof of Lemma 1. There are a total of ψr paths of length r from input to output, and a total of Λr unique r length configurations of weights. The uniformity assumption then implies that each configuration of weights is repeated ψrΛr times. By summing over the unique configurations, and re indexing the input we arrive at Eq. 10.
Proof of Lemma 2. From 12, we have that ξi1,i2...ir is defined as a sum of ψr Λr inputs. Since there are only p distinct inputs, it holds that for each ξi1,i2...ir there exists a sequence α = (αi) p i=1 ∈ N such
that ∑d i=1 αi = ψr Λr , and ξi1,i2...ir = ∑d i=1 αixi. We, therefore, have that E[ξ2i1,i2...ir ] = ‖α‖ 2 2. Note that the minimum value of E[ξ2i1,i2...ir ] is a solution to the following:
min(E[ξ2i1,i2...ir ]) = minα(‖α‖2) s.t ‖α‖1 = ψr Λr , (αi) p i=1 ∈ N, (36)
which achieves its minimal value at ∀i, αi = 1d ψr Λr . Similarly, the maximum value is achieved at αi = ψr Λr δi for some index i.
Proof of Thm. 1. We use the stirling approximation, which states limp→∞ 1p log( ( p αp ) ) = H(α), where H(α) = −αlog(α)− (1−α)log(1−α). Ignoring the constants which do not depend on α,
lim p→∞
1 p log(
( p
αp
) βαp) = H(α) + αlog(β) (37)
which achieves its maximum value at α = α∗.
Proof of Thm. 2. For brevity, we provide a sketch of the proof. It is enough to show that limp→∞ ∑α1p r=1 2 r = 0 for β < 1. Ignoring the constants in the binomial terms, we have:
lim p→∞ α1p∑ r=1 2i = lim p→∞ ∑α1p i=1 ( p r )2 β2r z2 ≤ lim p→∞ α1p ( p α1p )2 β2α1p z2 (38)
Where z2 = ∑p r=1 ( p r )2 β2r, which can be expressed using the Legendre polynomial of order p:
z2 = (1− β2)pPp( 1 + β2
1− β2 ) (39)
In order to compute the limit of Eq. 38, we use the asymptotic of the Legendre polynomial of order p for x > 1, Pp(x) ∼ 1√2πp (x+ √ x2−1)p+ 1 2
(x2−1) 1 4
. For the term in the nominator of Eq. 38 , we use the
Stirling approximation for factorials p! ∼ √
2πp(pe ) p. Substituting both approximations in Eq. 38
and taking the limit completes the proof.
Proof of Lemma 4. For simplicity, we ignore the constants in the binomial coefficient, and assume r = 1 z ( p r ) βr. Notice that for β∗ = ( p p 2 ) , we have that arg maxr( r(β ∗)) = p, arg maxr( r( 1 β∗ )) = 1 and arg maxr( r(1)) = p 2 . From the monotonicity and continuity of β
r, any value 1 ≥ k ≥ p can be attained. The linear dependency β(C) = ρnC√
Λ completes the proof.
Proof of Thm. 3. 1. Notice that by definition, layer l is not skipped by the residual connection, and therefore λl multiplies every path in the network. Therefore,
∂LN (x,w) ∂λl = 1λl (Lm(x,w) + Lp(x,w)). Using taylor series expansion:
∂LN (x,w − µg) ∂λl ≈ ∂LN (x,w) ∂λl − µ∇w ∂LN (x,w) ∂λl g (40)
Substituting∇w ∂LN (x,w)∂λl = 1 λl (gm + gp) in 40 we have:
∂LN (x,w− µgw) ∂λl ≈ 0− µ 1 λl (gm + gp) >(gm + gp) = −µ 1 λl ‖gm + gp‖22 < 0 (41)
And hence:
λl − µ ∂LN (x,w− µgw)
∂λl = λl + µ
2 1
λl ‖gm + gp‖22
= λl(1 + µ 2 1
λ2l ‖gm + gp‖22) (42)
Finally:
|λl(1 + µ2 1
λ2l ‖gm + gp‖22)| = |λl|(1 + µ2
1
λ2l ) ≥ |λl| (43)
2. Since paths of length m skip layer l, we have that∇w ∂LN (x,w)∂λl = 1 λl gp. Therefore:
∂LN (x,w − µg) ∂λl ≈ 0− µ 1 λl (gm + gp) >gp = −µ 1 λl (g>mgp + ‖gp‖22) (44)
The condition ‖gp‖2 > ‖gm‖2 implies that g>mgp + ‖gp‖22 > 0, completing the proof.
Proof of Thm 4. Notice that ∂LN (x,w)∂C = ∂LN (x,w) ∂w ∂w ∂‖w‖2
√ Λ = g>w̃ = 0, and hence the gradient
is orthogonal to the weights. We have that ∂LN (x,w)∂C = 1 C (mLm(x,w) + pLp(x,w)). Using taylor series expansion we have:
∂LN (x,w − µg) ∂C ≈ ∂LN (x,w) ∂C − µ∇w ∂LN (x,w) ∂C g (45)
For the last term we have:
∇w ∂LN (x,w)
∂C g = (mLm(x,w) + pLp(x,w))∇w
√ Λ
‖w‖2 g +
1 C (mgm + pgp) >g
= (mLm(x,w) + pLp(x,w)) w>g
C 3 2
+ 1
C (mgm + pgp)
>g = 1
C (mgm + pgp)
>g, (46)
where the last step stems from the fact thatw>g = 0. Substituting∇w ∂LN (x,w)∂C = 1 C (mgm+pgp) in 45 we have:
∂LN (x,w− µgw) ∂C ≈ 0− µ 1 C (mgm + pgp) >(gm + gp)
= −µ 1 C (m‖gp‖22 + p‖gp‖22 + (m+ p)g>p gm) (47)
Proof of Thm 5. Inserting Eq. 31 into Eq. 33 we have that:
θk(R, ) = 1
2 log(
∑p r=2
2 rr(r − 1)∑p
r=2 2 rr
)− ∑p r=2 2 rr(r − 2)∑p
r=2 2 rr
2 (48)
We denote the matrices V ′ and V ′′ such that V ′ij = rδij and V ′′ ij = r(r − 1)δij . We then have:
θk(R, ) = 1
2 log(
>V ′′ >V ′ )− >(V ′′ − V ′) >(V ′′ + V ′)
(49)
max θk(R, ) ≤ max ( 1
2 log(
>V ′′ >V ′ ))−min ( >(V ′′ − V ′) >(V ′′ + V ′) )
= 1
2 log
( maxi(V ′′ iiV ′−1 ii ) ) −mini ( (V ′′ii − V ′ii)(V ′′ii + V ′ii)−1 ) = 1
2 log(p− 1)− (1− 2 p ) = θk(R, ∗) (50)
C ADDITIONAL EXPERIMENTS
Fig. 1(d) and 1(e) report the experimental results of a straightforward setting, in which the task is to classify a mixture of 10 multivariate Gaussians in 50D. The input is therefore of size 50. The loss employed is the cross entropy loss of ten classes. The network has 10 blocks, each containing 20 hidden neurons, a batch normalization layer, and a skip connection. Training was performed on 10,000 samples, using SGD with minibatches of 50 samples.
Next, we provide additional experiments performed on the public CIFAR-10 and CIFAR-100 data sets (Krizhevsky, 2009). The public ResNet code of https://github.com/facebook/fb. resnet.torch is used for networks of depth 32.
As noted in Sec. 4.2, the dynamic behavior can be present in the Batch Normalization multiplicative coefficient or in the weight matrices themselves. In the following experiments, it seems that
until the learning rate is reduced, the dynamic behavior is manifested in the Batch Normalization multiplicative coefficients and then it moves to the convolution layers themselves. We therefore absorb the BN coefficients into the convolutional layer using the public code of https: //github.com/e-lab/torch-toolbox/tree/master/BN-absorber. Note that the multiplicative coefficient of Batch Normalization is typically refereed to as γ. However, throughout our paper, since we follow the notation of Choromanska et al. (2015a), γ refers to the number of paths. The multiplicative factor of Batch normalization appears as λ in Sec. 4.
Fig. 2 depicts the results. There are two types of plots: Fig. 2(a,c) presents for CIFAR-10 and CIFAR-100 respectively the magnitude of the various convolutional layers for multiple epochs (similar in type to Fig. 1(d) in the paper). Fig. 2(b,d) depict for the two datasets the mean of these norms over all convolutional layers as a function of epoch (similar to Fig. 1(e)).
As can be seen, the dynamic phenomenon we describe is very prominent in the public ResNet implementation when applied to these conventional datasets: the dominance of paths with fewer skip connections increases over time. Moreover, once the learning rate is reduced in epoch 81 the phenomenon we describe speeds up.
In Fig. 3 we present the multiplicative coefficient of the Batch Normalization when not absorbed. As future work, we would like to better understand why these coefficients start to decrease once the learning rate is reduced. As shown above, taking the magnitude of the convolutions into account, the dynamic phenomenon we study becomes even more prominent at this point. The change of location from the multiplicative coefficient of the Batch Normalization layers to the convolutions themselves might indicate that Batch Normalization is no longer required at this point. Indeed, Batch Normalization enables larger training rates and this shift happens exactly when the training rate is reduced. A complete analysis is left for future work.
This paper extend the Spin Glass analysis of Choromanska et al. (2015a) to Res Nets which yield the novel dynamic ensemble results for Res Nets and the connection to Batch Normalization and the analysis of their loss surface of Res Nets.
The paper is well-written with many insightful explanation of results. Although the technical contributions extend the Spin Glass model analysis of the ones by Choromanska et al. (2015a), the updated version could eliminate one of the unrealistic assumptions and the analysis further provides novel dynamic ensemble results and the connection to Batch Normalization that gives more insightful results about the structure of Res Nets. 
It is essential to show this dynamic behaviour in a regime without batch normalization to untangle the normalization effect on ensemble feature. Hence authors claim that steady increase in the L_2 norm of the weights will maintain the this feature but setting for Figure 1 is restrictive to empirically support the claim. At least results on CIFAR 10 without batch normalization for showing effect of L_2 norm increase and results that support claims about Theorem 4 would strengthen the paper.
This work provides an initial rigorous framework to analyze better the inherent structure of the current state of art Res Net architectures and its variants which can stimulate potentially more significant results towards careful understanding of current state of art models (Rather than always to attempting to improve the performance of Res Nets by applying intuitive incremental heuristics, it is important to progress on some solid understanding too).