Simple Algorithm
Machine Learning · Convergence · 28 min

Initialization & Signal Propagation

Keeping activations and gradients alive through depth.

Before a deep network learns anything, its random initial weights decide whether a signal entering the first layer reaches the last one, and whether a gradient can travel back. Get the scale slightly wrong and both shrink or grow exponentially with depth. This lesson derives the classic initializations from variance propagation, develops the mean-field theory of order, chaos and the edge between them, shows why the whole spectrum of the Jacobian matters, and explains how residual scaling, Fixup and gated recurrent cells keep very deep computations trainable.

What you’ll learn

  • Derive Glorot and He initialization from the forward and backward propagation of variance, including ReLU's factor 12\tfrac12.
  • Compute the fixed point of the length map and the slope χ1\chi_1 that separates ordered from chaotic networks, and connect χ1\chi_1 to vanishing and exploding gradients and to trainable depth.
  • Explain dynamical isometry: why Gaussian weights give a Jacobian spectrum whose variance grows linearly with depth, why orthogonal weights do not, and why ReLU networks cannot reach isometry.
  • Derive the variance growth of residual networks and Fixup's scaling L−1/(2m−2)L^{-1/(2m-2)}, and bound gradients through time in recurrent networks.

Variance propagation

Take a fully connected layer zi(l)=∑jWij(l)hj(l−1)+bi(l)z^{(l)}_i=\sum_jW^{(l)}_{ij}h^{(l-1)}_j+b^{(l)}_i at initialization, with independent zero-mean weights of variance σw2/nl−1\sigma_w^2/n_{l-1}, biases of variance σb2\sigma_b^2, and weights independent of the incoming activations. Track the variance of a pre-activation forward, and of an error signal δj(l)=∂ℓ/∂zj(l)\delta^{(l)}_j=\partial\ell/\partial z^{(l)}_j backward.

DerivationForward and backward, layer by layer
  1. q(l)=Var⁡(zi(l))=σw2 E[φ(z(l−1))2]+σb2q^{(l)}=\Var\big(z^{(l)}_i\big)=\sigma_w^2\,\E\big[\varphi\big(z^{(l-1)}\big)^2\big]+\sigma_b^2

    Forward. A sum of nl−1n_{l-1} independent zero-mean terms has variance equal to the sum of their second moments. Note the second moment E[φ(z)2]\E[\varphi(z)^2], not the variance: ReLU outputs do not have mean zero.

  2. q(l)=σw22 q(l−1)⟹q(L)=(σw22)L−1q(1),σw2=2 preserves itq^{(l)}=\frac{\sigma_w^2}2\,q^{(l-1)}\quad\Longrightarrow\quad q^{(L)}=\Big(\frac{\sigma_w^2}2\Big)^{L-1}q^{(1)},\qquad\sigma_w^2=2\ \text{preserves it}

    ReLU. For zz symmetric about 0, ReLU keeps exactly half of the second moment: E[ReLU(z)2]=12E[z2]\E[\mathrm{ReLU}(z)^2]=\tfrac12\E[z^2]. With σb=0\sigma_b=0, the variance is preserved through any number of layers exactly when σw2=2\sigma_w^2=2, that is Var⁡(W)=2/fan-in\Var(W)=2/\text{fan-in} (He, Zhang, Ren & Sun, 2015). For tanh⁡\tanh near the origin, φ(z)≈z\varphi(z)\approx z and the same argument gives Var⁡(W)=1/fan-in\Var(W)=1/\text{fan-in}.

  3. Var⁡(δ(l))=nl+1 Var⁡(W(l+1)) E[φ′(z(l))2] Var⁡(δ(l+1))\Var\big(\delta^{(l)}\big)=n_{l+1}\,\Var\big(W^{(l+1)}\big)\,\E\big[\varphi'\big(z^{(l)}\big)^2\big]\,\Var\big(\delta^{(l+1)}\big)

    Backward. δj(l)=φ′(zj(l))∑kWkj(l+1)δk(l+1)\delta^{(l)}_j=\varphi'(z^{(l)}_j)\sum_kW^{(l+1)}_{kj}\delta^{(l+1)}_k sums nl+1n_{l+1} terms. Treating the backward weights as independent of the forward signal (the standard mean-field approximation):

  4. Glorot: Var⁡(W)=2nin+nout, e.g. W∼U[−6nin+nout,6nin+nout];He: Var⁡(W)=2nin\text{Glorot: }\Var(W)=\frac2{n_{\text{in}}+n_{\text{out}}},\ \text{e.g. }W\sim U\Big[-\sqrt{\tfrac6{n_{\text{in}}+n_{\text{out}}}},\sqrt{\tfrac6{n_{\text{in}}+n_{\text{out}}}}\Big];\qquad\text{He: }\Var(W)=\frac2{n_{\text{in}}}

    For ReLU, E[φ′2]=12\E[\varphi'^2]=\tfrac12, so the backward pass wants Var⁡(W)=2/fan-out\Var(W)=2/\text{fan-out}. Glorot & Bengio (2010), working with tanh-like units near their linear regime, compromised between 1/fan-in1/\text{fan-in} and 1/fan-out1/\text{fan-out}; He et al. observed that either condition alone suffices, because the other side's product of width ratios telescopes to a constant such as n1/nLn_1/n_L instead of shrinking exponentially.

Predict before you look

A 50-layer ReLU network is initialized with Var⁡(W)=1/fan-in\Var(W)=1/\text{fan-in} (appropriate for tanh, not ReLU) and no biases. By what factor does the pre-activation variance shrink from the first layer to the last? Give log⁡10\log_{10} of the factor.

Show the answer

-15

With σw2=1\sigma_w^2=1 the recursion is q(l)=12q(l−1)q^{(l)}=\tfrac12q^{(l-1)}: 49 halvings separate layer 1 from layer 50, a factor 2−49≈1.8×10−152^{-49}\approx1.8\times10^{-15}, about 10−1510^{-15}. The signal reaching the output is drowned out by rounding errors, and by the backward formula the gradient shrinks the same way. With Var⁡(W)=2/fan-in\Var(W)=2/\text{fan-in} the factor would be exactly 1.

SchemeVar⁡(W)\Var(W)Designed forSource
LeCun1/nin1/n_{\text{in}}tanh-like units near the originLeCun, Bottou, Orr & Müller (1998)
Glorot (Xavier)2/(nin+nout)2/(n_{\text{in}}+n_{\text{out}})tanh, sigmoid, linear; balances forward and backwardGlorot & Bengio (2010)
He (Kaiming)2/nin2/n_{\text{in}} (or 2/nout2/n_{\text{out}})ReLUHe, Zhang, Ren & Sun (2015)
OrthogonalW=gQW=gQ, Q⊤Q=IQ^\top Q=Iany; exact norm preservation in linear networksSaxe, McClelland & Ganguli (2014)
All of them pick a scale that keeps a layer's typical gain near 1 on average. The next two steps ask what happens to correlations between inputs, and to the spread of gains around that average.

Order, chaos and the edge

Poole, Lahiri, Raghu, Sohl-Dickstein & Ganguli (2016) and Schoenholz, Gilmer, Ganguli & Sohl-Dickstein (2017) followed two inputs x,x′\mathbf x,\mathbf x' through a wide random network, tracking each one's length q(l)q^{(l)} and their correlation c(l)c^{(l)}. In the wide limit, both evolve by deterministic maps. Write ∫ ⁣Dz\int\!\mathcal Dz for an average over a standard Gaussian zz.

DerivationThe two maps and the slope that decides everything
  1. q(l)=σw2∫ ⁣Dz φ(q(l−1) z)2+σb2 ⟶ q⋆q^{(l)}=\sigma_w^2\int\!\mathcal Dz\ \varphi\Big(\sqrt{q^{(l-1)}}\,z\Big)^2+\sigma_b^2\ \longrightarrow\ q^\star

    Length. The forward variance recursion, iterated, converges to a fixed point q⋆q^\star for bounded activations:

  2. c(l)=1q⋆(σw2∫ ⁣Dz1Dz2 φ(u1)φ(u2)+σb2)c^{(l)}=\frac1{q^\star}\Big(\sigma_w^2\int\!\mathcal Dz_1\mathcal Dz_2\ \varphi(u_1)\varphi(u_2)+\sigma_b^2\Big)

    Correlation. At the fixed length, the pre-activations of the two inputs are jointly Gaussian with correlation cc; write u1=q⋆z1u_1=\sqrt{q^\star}z_1 and u2=q⋆(cz1+1−c2 z2)u_2=\sqrt{q^\star}\big(cz_1+\sqrt{1-c^2}\,z_2\big):

  3. χ1=∂c(l)∂c(l−1)∣c=1=σw2∫ ⁣Dz φ′(q⋆ z)2\chi_1=\frac{\partial c^{(l)}}{\partial c^{(l-1)}}\Big|_{c=1}=\sigma_w^2\int\!\mathcal Dz\ \varphi'\Big(\sqrt{q^\star}\,z\Big)^2

    c=1c=1 is always a fixed point: identical inputs stay identical. Its stability is the slope of the correlation map there, which differentiates to

  4. χ1<1: order,χ1=1: critical,χ1>1: chaos\chi_1<1:\ \text{order},\qquad\chi_1=1:\ \text{critical},\qquad\chi_1>1:\ \text{chaos}

    Ordered phase (χ1<1\chi_1<1): nearby inputs converge, 1−c(l)∝e−l/ξc1-c^{(l)}\propto e^{-l/\xi_c} with depth scale ξc=−1/ln⁡χ1\xi_c=-1/\ln\chi_1, so deep layers can no longer tell inputs apart. Chaotic phase (χ1>1\chi_1>1): nearby inputs decorrelate toward a fixed point c⋆<1c^\star<1, and tiny input changes produce large output changes. At the edge of chaos, χ1=1\chi_1=1, the depth scale diverges.

  5. E∥δ(l)∥2 ≈ χ1 E∥δ(l+1)∥2\E\norm{\boldsymbol\delta^{(l)}}^2\ \approx\ \chi_1\,\E\norm{\boldsymbol\delta^{(l+1)}}^2

    The same number governs gradients. In the backward recursion with equal widths, nVar⁡(W)E[φ′2]n\Var(W)\E[\varphi'^2] is exactly χ1\chi_1. So the ordered phase is the vanishing-gradient phase and the chaotic phase the exploding one (Schoenholz et al., 2017):

σb\sigma_b00.050.10.20.30.5
critical σw\sigma_w (χ1=1\chi_1=1)11.121.191.301.401.55
fixed point q⋆q^\star there00.150.270.510.761.32
The order-to-chaos line for tanh⁡\tanh, computed by numerical integration of the maps above. With σb=0.05\sigma_b=0.05 and σw=1\sigma_w=1 the network is ordered, with χ1≈0.934\chi_1\approx0.934 and ξc≈15\xi_c\approx15 layers. For ReLU with σb=0\sigma_b=0, χ1=σw2/2\chi_1=\sigma_w^2/2: He initialization is the critical point, although ReLU correlations still drift slowly toward 1 with depth even there.

The practical claim of Schoenholz et al. is that random networks are trainable precisely when information can travel through them: the depth scales bound how deep a network can be trained for given (σw,σb)(\sigma_w,\sigma_b), and arbitrarily deep networks train only close to criticality. They also showed that dropout destroys the critical point, which limits trainable depth.

Dynamical isometry: the whole spectrum

χ1=1\chi_1=1 pins the mean squared singular value of the input–output Jacobian J=D(L)W(L)⋯D(1)W(1)J=D^{(L)}W^{(L)}\cdots D^{(1)}W^{(1)} at 1, but gradient-based learning also cares about the spread. If some singular values are huge and others tiny, gradient steps are badly conditioned even though the average is fine. Dynamical isometry asks for all singular values of JJ to concentrate near 1 (Saxe, McClelland & Ganguli, 2014; Pennington, Schoenholz & Ganguli, 2017).

DerivationDeep linear networks: Gaussian versus orthogonal
  1. 1nEtr⁡(JJ⊤)=1for all L\frac1n\E\operatorname{tr}\big(JJ^\top\big)=1\qquad\text{for all }L

    Take a linear network (φ(z)=z\varphi(z)=z) with independent Gaussian n×nn\times n weight matrices of variance 1/n1/n, the critical scale. Each layer preserves the expected squared norm, so the mean squared singular value of J=W(L)⋯W(1)J=W^{(L)}\cdots W^{(1)} is 1 at every depth:

  2. m2=12L+1(2L+22)=L+1⟹Var⁡(s2)=m2−m12=Lm_2=\frac1{2L+1}\binom{2L+2}2=L+1\quad\Longrightarrow\quad\Var\big(s^2\big)=m_2-m_1^2=L

    As n→∞n\to\infty, the squared singular values of a product of LL such matrices follow the Fuss–Catalan distribution, whose moments are mk=1Lk+1((L+1)kk)m_k=\frac1{Lk+1}\binom{(L+1)k}k. The second moment is L+1L+1, so the variance grows linearly with depth (and the largest squared singular value grows like (L+1)L+1/LL≈e(L+1)(L+1)^{L+1}/L^L\approx e(L+1)):

  3. W(l)⊤W(l)=I  ∀l⟹J⊤J=IW^{(l)\top}W^{(l)}=I\ \ \forall l\quad\Longrightarrow\quad J^\top J=I

    With orthogonal matrices (W⊤W=IW^\top W=I), JJ is a product of orthogonal matrices, hence orthogonal: every singular value is exactly 1 at every depth. Saxe et al. (2014) showed that deep linear networks initialized this way learn in a time that does not grow with depth, unlike scaled Gaussian initializations.

Predict before you look

A very wide 100-layer linear network has independent Gaussian weights at the critical scale. What is the variance of the squared singular values of its input–output Jacobian?

Show the answer

100

Var⁡(s2)=L=100\Var(s^2)=L=100, while the mean stays exactly 1: a spectrum so spread out that the largest squared singular values are hundreds of times the typical ones. The same network with orthogonal weights has variance 0. A quick simulation with n=300n=300 gives about 1, 2, 5 and 10.6 for L=1,2,5,10L=1,2,5,10, close to the wide-limit values.

With nonlinearities, each D(l)=diag⁡(φ′(z(l)))D^{(l)}=\operatorname{diag}(\varphi'(\mathbf z^{(l)})) also shapes the spectrum. Using free probability, Pennington, Schoenholz & Ganguli (2017) computed the full singular-value distribution of JJ and found that ReLU networks are incapable of dynamical isometry: about half of each D(l)D^{(l)} is zero, which spreads the spectrum whatever the weight scale. Sigmoidal networks can reach isometry, but only with orthogonal weights, at criticality and with small q⋆q^\star so that most units operate near their linear regime; such networks trained orders of magnitude faster than ones that were not isometric. Xiao, Bahri, Sohl-Dickstein, Schoenholz & Pennington (2018) extended the conditions to convolutions with orthogonal kernels and trained plain convolutional networks with 10,000 layers.

Residual networks and Fixup

A residual block computes x(l+1)=x(l)+Fl(x(l))\mathbf x^{(l+1)}=\mathbf x^{(l)}+F_l(\mathbf x^{(l)}), so its Jacobian is I+∂Fl/∂xI+\partial F_l/\partial\mathbf x, and gradients always have the identity path. The forward pass, however, has its own problem. At initialization, with zero-mean weights in FlF_l, the cross term vanishes in expectation:

E∥x(l+1)∥2=E∥x(l)∥2+E∥Fl(x(l))∥2.\E\norm{\mathbf x^{(l+1)}}^2=\E\norm{\mathbf x^{(l)}}^2+\E\norm{F_l(\mathbf x^{(l)})}^2 .

If every branch is He-initialized so that E∥Fl(x)∥2≈E∥x∥2\E\norm{F_l(\mathbf x)}^2\approx\E\norm{\mathbf x}^2, the squared norm doubles at every block: 2L2^L growth over LL blocks. Scaling each branch by α\alpha gives (1+α2)L(1+\alpha^2)^L; with α=1/L\alpha=1/\sqrt L this is (1+1/L)L≤e(1+1/L)^L\le e, bounded at any depth. Normalization does something similar implicitly: De & Smith (2020) showed that at initialization batch normalization downscales each residual branch relative to the skip connection by a factor on the order of the square root of the depth, so deep normalized residual networks start out close to the identity.

DerivationFixup's scaling (Zhang, Dauphin & Ma, 2019)
  1. ΔF ∼ η sm−1⋅sm−1=η s2m−2\Delta F\ \sim\ \eta\,s^{m-1}\cdot s^{m-1}=\eta\,s^{2m-2}

    Let each of the LL residual branches be mm layers with ReLU between them, F(x)=Wm ReLU(Wm−1⋯ReLU(W1x))F(\mathbf x)=W_m\,\mathrm{ReLU}(W_{m-1}\cdots\mathrm{ReLU}(W_1\mathbf x)), and scale the branch's weights by ss relative to He initialization. The gradient with respect to one layer's weights carries the other m−1m-1 layers' scales, a factor sm−1s^{m-1}, and a step of size η\eta changes the branch's output by that weight change times another sm−1s^{m-1}:

  2. L η s2m−2=Θ(η)⟹s=L−1/(2m−2)L\,\eta\,s^{2m-2}=\Theta(\eta)\quad\Longrightarrow\quad s=L^{-1/(2m-2)}

    Fixup ("fixed update") asks that one SGD step change the network's output by Θ(η)\Theta(\eta) in total, independent of depth. With LL branches each contributing ηs2m−2\eta s^{2m-2}:

  3. L=100, m=2: s=0.1;L=100, m=3: s≈0.32L=100,\ m=2:\ s=0.1;\qquad L=100,\ m=3:\ s\approx0.32

    The full recipe: (1) initialize the classification layer and the last layer of each residual branch to zero; (2) initialize every other layer with a standard method such as He, and scale the weight layers inside residual branches by L−1/(2m−2)L^{-1/(2m-2)}; (3) add a scalar multiplier (starting at 1) to every branch and scalar biases (starting at 0) before each convolution, linear and activation layer. The authors found rule 2 essential, and with it trained residual networks of 10,000 layers, without normalization, as stably as with it.

Check your understanding

A residual network without normalization has 50 residual branches of 2 layers each. By what factor does Fixup scale the weight layers inside the branches?

  1. 1/50=0.021/50=0.02
  2. 50−1/4≈0.3850^{-1/4}\approx0.38
  3. 50−1/2≈0.1450^{-1/2}\approx0.14
  4. 1: Fixup only zeroes the last layer
Show the answer

C. 50−1/2≈0.1450^{-1/2}\approx0.14

With m=2m=2, the exponent is −1/(2m−2)=−12-1/(2m-2)=-\tfrac12, so s=50−1/2≈0.14s=50^{-1/2}\approx0.14. Deeper branches need less scaling per layer, because the scales of their mm layers multiply: m=3m=3 would give 50−1/450^{-1/4}.

Depth in time: recurrent networks

A recurrent network ht=φ(Wht−1+Uxt+b)\mathbf h_t=\varphi(W\mathbf h_{t-1}+U\mathbf x_t+\mathbf b) is a network as deep as its sequence is long, with the same weights at every layer. A loss at time TT reaches the state at time tt through a product of T−tT-t Jacobians.

DerivationGradients through time (Pascanu, Mikolov & Bengio, 2013)
  1. ∂hT∂ht=∏k=t+1Tdiag⁡(φ′(zk)) W,zk=Whk−1+Uxk+b\frac{\partial\mathbf h_T}{\partial\mathbf h_t}=\prod_{k=t+1}^{T}\operatorname{diag}\big(\varphi'(\mathbf z_k)\big)\,W,\qquad\mathbf z_k=W\mathbf h_{k-1}+U\mathbf x_k+\mathbf b

    Differentiate the recursion step by step:

  2. ∥∂hT∂ht∥ ≤ (γ σmax⁡(W))T−t\Big\lVert\frac{\partial\mathbf h_T}{\partial\mathbf h_t}\Big\rVert\ \le\ \big(\gamma\,\sigma_{\max}(W)\big)^{T-t}

    Let ∣φ′∣≤γ\abs{\varphi'}\le\gamma (γ=1\gamma=1 for tanh, 14\tfrac14 for the sigmoid) and σmax⁡(W)\sigma_{\max}(W) be the largest singular value. Submultiplicativity of the spectral norm gives a geometric bound:

  3. ∂ℓT∂W=∑t≤T∂ℓT∂hT ∂hT∂ht ∂+ht∂W\frac{\partial\ell_T}{\partial W}=\sum_{t\le T}\frac{\partial\ell_T}{\partial\mathbf h_T}\,\frac{\partial\mathbf h_T}{\partial\mathbf h_t}\,\frac{\partial^+\mathbf h_t}{\partial W}

    So σmax⁡(W)<1/γ\sigma_{\max}(W)<1/\gamma is sufficient for long-range gradient contributions to vanish exponentially; conversely σmax⁡(W)>1/γ\sigma_{\max}(W)>1/\gamma is necessary, but not sufficient, for them to explode. Since the gradient for WW sums contributions from all pairs t<Tt<T, the short-range terms dominate and long-range dependencies are learned slowly or not at all: the diagnosis of Hochreiter (1991) and Bengio, Simard & Frasconi (1994).

Explosions are handled by gradient clipping, g←g min⁡(1,τ/∥g∥)\mathbf g\leftarrow\mathbf g\,\min(1,\tau/\norm{\mathbf g}), which Pascanu et al. proposed together with this analysis. Vanishing needs a change of architecture. The LSTM (Hochreiter & Schmidhuber, 1997), in its now-standard form with a forget gate, carries a cell state updated additively, ct=ft⊙ct−1+it⊙gt\mathbf c_t=\mathbf f_t\odot\mathbf c_{t-1}+\mathbf i_t\odot\mathbf g_t; along that path the Jacobian is diag⁡(ft)\operatorname{diag}(\mathbf f_t), so when the forget gates stay near 1 the error flows back nearly undiminished over many steps. Orthogonal or unitary recurrent matrices attack the same product directly, and residual connections play the same role across depth.

Key takeaways

  • Variance propagation, q(l)=σw2E[φ(z)2]+σb2q^{(l)}=\sigma_w^2\E[\varphi(z)^2]+\sigma_b^2 forward and Var⁡(δ(l))=nl+1Var⁡(W)E[φ′2]Var⁡(δ(l+1))\Var(\delta^{(l)})=n_{l+1}\Var(W)\E[\varphi'^2]\Var(\delta^{(l+1)}) backward, gives He (2/fan-in2/\text{fan-in}, for ReLU's factor 12\tfrac12) and Glorot (2/(nin+nout)2/(n_{\text{in}}+n_{\text{out}})) initialization.
  • In wide random networks, χ1=σw2∫ ⁣Dz φ′(q⋆z)2\chi_1=\sigma_w^2\int\!\mathcal Dz\,\varphi'(\sqrt{q^\star}z)^2 separates order (χ1<1\chi_1<1, vanishing gradients, depth scale −1/ln⁡χ1-1/\ln\chi_1) from chaos (χ1>1\chi_1>1, exploding gradients); trainable depth diverges only at the edge of chaos.
  • Dynamical isometry needs the whole Jacobian spectrum near 1: critical Gaussian linear networks have Var⁡(s2)=L\Var(s^2)=L, orthogonal ones are exactly isometric, and ReLU networks cannot be isometric at all.
  • Residual branches add variance, 2L2^L growth if unscaled; scaling by 1/L1/\sqrt L, normalization, or Fixup's L−1/(2m−2)L^{-1/(2m-2)} with zero-initialized last layers keeps very deep residual networks trainable.
  • Through time, ∥∂hT/∂ht∥≤(γσmax⁡(W))T−t\norm{\partial\mathbf h_T/\partial\mathbf h_t}\le(\gamma\sigma_{\max}(W))^{T-t}: clipping tames explosions, and additive gated memory (LSTM) keeps gradients alive.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

Why does He initialization use Var⁡(W)=2/fan-in\Var(W)=2/\text{fan-in} for ReLU layers, twice the value used for tanh?

  1. Because ReLU outputs are twice as large as tanh outputs
  2. Because ReLU discards the negative half of a symmetric pre-activation, so its second moment is 12E[z2]\tfrac12\E[z^2], and the factor 2 makes up for the loss
  3. Because ReLU networks have twice as many parameters
  4. Because the backward pass needs twice the variance of the forward pass
Show the answer

B. Because ReLU discards the negative half of a symmetric pre-activation, so its second moment is 12E[z2]\tfrac12\E[z^2], and the factor 2 makes up for the loss

The forward recursion is q(l)=σw2E[φ(z)2]q^{(l)}=\sigma_w^2\E[\varphi(z)^2]. For ReLU the second moment is half of q(l−1)q^{(l-1)}, so σw2=2\sigma_w^2=2 keeps qq constant; for tanh near the origin E[φ(z)2]≈q\E[\varphi(z)^2]\approx q and σw2=1\sigma_w^2=1 suffices.

Question 2

In the mean-field theory of a deep tanh network, χ1>1\chi_1>1. What does that imply?

  1. Nearby inputs become more and more similar with depth, and gradients vanish
  2. The network is exactly at the edge of chaos
  3. Nearby inputs decorrelate with depth, and mean squared gradients grow from layer to layer
  4. Nothing about gradients: χ1\chi_1 concerns only the forward pass
Show the answer

C. Nearby inputs decorrelate with depth, and mean squared gradients grow from layer to layer

χ1\chi_1 is the derivative of the correlation map at its fixed point c=1c=1; above 1 that fixed point repels, so small input differences are amplified (chaos). The same χ1\chi_1 multiplies E∥δ∥2\E\norm{\boldsymbol\delta}^2 per layer going backward, so gradients explode.

Question 3

Which initialization gives a deep linear network an input–output Jacobian whose singular values are all exactly 1?

  1. Orthogonal weight matrices
  2. Gaussian weights with variance 1/n1/n
  3. Gaussian weights with variance 2/n2/n
  4. All weights equal to 1/n1/n
Show the answer

A. Orthogonal weight matrices

A product of orthogonal matrices is orthogonal, so every singular value is 1 at every depth. Critical Gaussian weights get the mean squared singular value right but leave a spread with variance LL; variance 2/n2/n doubles the squared norm at every layer.

Question 4

A tanh recurrent network has a recurrent matrix with largest singular value 1.5. Must its gradients explode over long sequences?

  1. Yes: 1.5T1.5^{T} grows without bound
  2. Yes, unless gradient clipping is used
  3. No: they always vanish, because tanh saturates
  4. No: σmax⁡(W)>1/γ\sigma_{\max}(W)>1/\gamma is necessary for explosion but not sufficient; the activation slopes and the directions involved can still make the product shrink
Show the answer

D. No: σmax⁡(W)>1/γ\sigma_{\max}(W)>1/\gamma is necessary for explosion but not sufficient; the activation slopes and the directions involved can still make the product shrink

The bound (γσmax⁡)T−t(\gamma\sigma_{\max})^{T-t} is only an upper bound. Saturated units have small φ′\varphi', and the error signal need not align with the top singular direction, so the actual product can shrink even when σmax⁡(W)>1\sigma_{\max}(W)>1. Explosion requires σmax⁡>1/γ\sigma_{\max}>1/\gamma, but that is not enough to cause it.

Further reading

  • X. Glorot & Y. Bengio, "Understanding the difficulty of training deep feedforward neural networks," Proceedings of the 13th International Conference on Artificial Intelligence and Statistics, PMLR 9, 249–256 (2010).
  • K. He, X. Zhang, S. Ren & J. Sun, "Delving deep into rectifiers: surpassing human-level performance on ImageNet classification," IEEE International Conference on Computer Vision (ICCV) (2015).
  • S. S. Schoenholz, J. Gilmer, S. Ganguli & J. Sohl-Dickstein, "Deep information propagation," International Conference on Learning Representations (ICLR) (2017).
  • J. Pennington, S. S. Schoenholz & S. Ganguli, "Resurrecting the sigmoid in deep learning through dynamical isometry: theory and practice," Advances in Neural Information Processing Systems 30 (2017).
  • H. Zhang, Y. N. Dauphin & T. Ma, "Fixup initialization: residual learning without normalization," International Conference on Learning Representations (ICLR) (2019).