21.4 Spectra in Practice
In Section 21.3, our matrices were small enough to factor by hand, and their eigenvalues delivered on every promise: the surfer's error shrank by at every click, just as the second eigenvalue predicted. Outside textbook examples, both comforts vanish. The link matrix of the web has billions of rows, so nobody writes down its characteristic polynomial or computes a full eigendecomposition. Even when eigenvalues are known, they promise less than they appear to. A Jordan block whose eigenvalues are both still grew to norm 37 before decaying (Section 21.3.1.5), and backpropagation through a recurrent network multiplies a gradient by fifty different matrices rather than applying one matrix fifty times.
This section takes up those two problems in turn. First, what can we learn about the eigenvalues of a matrix that is far too large to factor? Surprisingly much: the entries alone confine all eigenvalues to a few discs in the complex plane, and repeated matrix--vector multiplication, the one operation that remains cheap at scale, finds the largest eigenvalue and its eigenvector. That is how PageRank was originally computed. Second, what do eigenvalues leave unsaid about a finite number of steps, or about a product of changing matrices? Here the answer is sobering. Eigenvalues govern the long-run behavior of powers of a single matrix; for anything else we need matrix norms, and ultimately the singular values of Section 21.5.
Not every topic below carries the same weight in deep learning, and it helps to know where to focus. Three ideas recur throughout the book. Power iteration (Section 21.4.1.2) estimates the largest stretch of a layer, which is the workhorse behind spectral normalization (Section 21.5.4.3). Transient growth and products of Jacobians (Section 21.4.2.3, Section 21.4.2.5) supply the mathematics behind the exploding and vanishing gradients of Section 8.5. And the random matrices of Section 21.4.2.6 model the weight matrices of Section 4.4 at initialization. Gershgorin's theorem and PageRank are classical highlights that appear less often in deep learning, so a reader in a hurry may skim both; pseudospectra (Section 21.4.2.4) are a specialized diagnostic that can likewise be skipped on a first reading. All numerical examples below use NumPy.
import numpy as np21.4.1 Locating and Computing Eigenvalues#
21.4.1.1 Gershgorin Discs#
Can we tell roughly where the eigenvalues of a matrix lie without ever computing them? For a diagonal matrix, the eigenvalues are simply the diagonal entries. Intuition suggests that if the off-diagonal entries are small, the eigenvalues should stay close to those diagonal entries. The following theorem makes that intuition exact, and its proof takes only three lines.
Theorem (Gershgorin (Gershgorin, 1931)). Let be any matrix, and for each row let be the sum of the absolute values of its off-diagonal entries. Let be the closed disc in the complex plane with centre and radius . Then every eigenvalue of lies in the union .
Proof. Suppose with , and pick an index where has its largest entry in magnitude, so that for all and . Reading off row of gives
Dividing both sides by and taking absolute values, we use the fact that for every :
which says that .
Notice what the proof actually tells us: each eigenvalue falls into the disc of the row where its eigenvector is largest. Because we do not know that row in advance, the theorem guarantees only that every eigenvalue lies somewhere in the union of all discs. To see this in action, consider the non-symmetric matrix
Its three discs have centres , , and , with radii , , and . The two discs centred at overlap (in fact, one sits inside the other), whereas the disc centred at is completely separated from them, because . The actual eigenvalues are and : the complex conjugate pair sits inside the two discs centred at , and the real eigenvalue sits inside the isolated disc centred at . Figure 21.4.1 displays the discs alongside the eigenvalues.
Gershgorin discs of the matrix in the text (centres at the diagonal entries, radii given by the sums of the absolute off-diagonal entries in each row) and its eigenvalues (crosses). The two overlapping discs centred at 4 together hold two eigenvalues, the complex pair; the disjoint disc centred at 1 holds the third.
That split, with two eigenvalues in the overlapping pair and one in the isolated disc, is no accident. If a union of discs is connected and disjoint from all the remaining discs, it contains exactly eigenvalues, counted with multiplicity. The reason is continuity: as we scale the off-diagonal entries from zero up to their actual values, the eigenvalues start at the diagonal entries and move continuously, so they can never jump across the empty gap between separated groups of discs (Horn and Johnson, 2012). Let us verify the centres, radii, and eigenvalues numerically.
A = np.array([[4.0, 1.0, 0.0],
[-1.0, 4.0, 0.5],
[0.5, 0.0, 1.0]])
centres = np.diag(A)
radii = np.abs(A).sum(axis=1) - np.abs(centres)
print('centres:', centres, ' radii:', radii)
for z in np.linalg.eigvals(A):
print(f'eigenvalue {z:.3f} distances to the centres: '
f'{np.abs(z - centres).round(2)}')
centres: [4. 4. 1.] radii: [1. 1.5 0.5]
eigenvalue 3.987+0.961j distances to the centres: [0.96 0.96 3.14]
eigenvalue 3.987-0.961j distances to the centres: [0.96 0.96 3.14]
eigenvalue 1.025+0.000j distances to the centres: [2.97 2.97 0.03]
Here the complex pair sits at distance from , right near the rim of the inner disc of radius , showing that Gershgorin's bound can be nearly tight.
One immediate corollary requires no computation at all. If is strictly diagonally dominant with positive diagonal entries, meaning for every , then every disc lies strictly in the open right half-plane. Zero cannot be an eigenvalue, so is automatically invertible. If is also symmetric, its eigenvalues are real and strictly positive, which makes it positive definite.
21.4.1.2 Power Iteration#
Gershgorin discs locate eigenvalues only roughly. What if we want an accurate eigenvalue of a matrix with a billion rows? Factoring such a matrix is out of the question, yet if it is sparse we can still multiply it by a vector cheaply. What happens if we start with a vector and simply multiply by over and over again?
The power expansion of Section 21.3.1.3 gives the answer. Suppose is diagonalizable with eigenvectors , ordered by the magnitude of their eigenvalues, and suppose the largest eigenvalue is strictly dominant, meaning . (When is real, strict dominance forces to be real as well, because a complex eigenvalue would share its modulus with its complex conjugate.) Expanding and factoring out yields
Every ratio for is strictly less than , so every trailing term vanishes as grows. Provided , the bracket converges to . Thus the direction of approaches the dominant eigenvector with an error decaying like , while its length scales by a factor approaching at each step. To keep the entries from overflowing or underflowing, we normalize the vector back to unit length after every multiplication; this simple loop is power iteration (Golub and Van Loan, 1996). When is symmetric, we can do even better for the eigenvalue itself: the Rayleigh quotient of the current iterate converges to at the squared rate . Because the eigenvectors of a symmetric matrix are orthogonal, a directional misalignment of size shifts the Rayleigh quotient only by (Exercise 2).
We can see both rates in a concrete example. In Section 1.3, we computed the iterates of starting from : , , , and in general . In terms of the unit eigenvectors and , we have , so
With , the directional error drops by a factor of at every step: the sine of the angle to is , , and for . Meanwhile the Rayleigh-quotient error drops by a factor of per step: , , and . Figure 21.4.2 plots both curves on a logarithmic scale.
Power iteration on starting from . The direction error drops by a factor of 3 per step, whereas the eigenvalue estimate improves by a factor of 9 per step, the squared rate that comes from orthogonal eigenvectors. Dashed lines show and .
When can power iteration fail? Two assumptions in (21.4.2) matter. First, the starting vector needs a nonzero component along (); choosing at random guarantees this with probability one. Second, the largest eigenvalue must be strictly dominant. If the largest modulus is shared by a complex conjugate pair, the dominant component of the iterate rotates indefinitely instead of settling on a single line. The ratio of consecutive norms then oscillates forever, just as it did for the running matrix of Section 21.3.1.6. Even in that case, however, the geometric average still converges to the largest modulus.
Matrices with strictly positive entries avoid this trouble altogether: as we will see in Section 21.4.1.3, the Perron--Frobenius theorem guarantees a real, simple, strictly dominant eigenvalue. Let us test this by running 200 steps of power iteration on a random matrix with entries drawn uniformly from , starting from a random vector, and comparing the final norm ratio with the true largest eigenvalue modulus.
A = np.random.rand(5, 5) # positive entries
v = np.random.randn(5)
for _ in range(200):
Av = A @ v
ratio = np.linalg.norm(Av) / np.linalg.norm(v)
v = Av / np.linalg.norm(Av)
mods = np.sort(np.abs(np.linalg.eigvals(A)))[::-1]
print(f'norm ratio after 200 steps = {ratio:.10f}')
print(f'largest |eigenvalue| = {mods[0]:.10f}')
print(f'|lambda_2| / |lambda_1| = {mods[1] / mods[0]:.3f}')norm ratio after 200 steps = 2.5254088042
largest |eigenvalue| = 2.5254088042
|lambda_2| / |lambda_1| = 0.299
On every draw, the norm ratio matches the largest eigenvalue modulus to all printed digits. To see how typical this fast convergence is, let us compute the gap ratio across 10,000 such positive matrices. For comparison, we also draw 10,000 matrices with standard Gaussian entries, which have no positivity guarantee, and measure how often their dominant eigenvalues form a complex conjugate pair.
mods = np.sort(np.abs(np.linalg.eigvals(np.random.rand(10000, 5, 5))), axis=1)
print('uniform entries, gap ratio |lambda_2| / |lambda_1|, 5% and 95% quantiles:',
np.quantile(mods[:, -2] / mods[:, -1], [0.05, 0.95]).round(2))
lam = np.linalg.eigvals(np.random.randn(10000, 5, 5))
top = lam[np.arange(10000), np.abs(lam).argmax(axis=1)] # a dominant eigenvalue
print('Gaussian entries, fraction with a complex dominant pair:',
np.mean(top.imag != 0).round(2))uniform entries, gap ratio |lambda_2| / |lambda_1|, 5% and 95% quantiles: [0.14 0.37]
Gaussian entries, fraction with a complex dominant pair: 0.43
For uniform positive entries, the gap ratio falls between roughly and in nine draws out of ten, so 200 iterations drive the direction error far below floating-point precision. For Gaussian entries, by contrast, about four draws in ten have a complex dominant pair, and on those matrices the norm ratio never settles.
21.4.1.3 PageRank#
For matrices with non-negative entries, the dominant eigenvector is often the very object we care about, and power iteration is how we compute it. To state when that eigenvector is unique and well behaved, call a non-negative matrix irreducible if, in the directed graph that places an edge whenever , every node can reach every other node. The Perron--Frobenius theorem (Horn and Johnson, 2012) guarantees that any irreducible non-negative matrix has a real, positive eigenvalue equal to the largest modulus among all its eigenvalues, that this eigenvalue is simple, and that its eigenvector can be chosen with strictly positive entries. If every entry of the matrix is strictly positive, this eigenvalue is also strictly dominant, meaning every other eigenvalue has strictly smaller modulus.
Google's original PageRank algorithm (Brin and Page, 1998) turns web ranking into exactly such an eigenvector problem. Consider a miniature web of three pages with links , , and . A random surfer follows an outgoing link chosen uniformly at random. Page has no outgoing links, so we repair that dead end by letting the surfer jump from page to any page with equal probability. The repaired transition matrix is column-stochastic, with column holding the click probabilities out of page :
In the long run, the fraction of time the surfer spends on each page is the stationary distribution satisfying . We can solve this by hand: rows and both give , and substituting back into row gives . Normalizing the entries to sum to yields . Page ranks first because page sends it all of its clicks, whereas page splits its clicks between pages and . The eigenvalues of are , , and , so power iteration from any initial distribution converges at the rate per step.
In fact, every column-stochastic matrix has as an eigenvalue of largest modulus. First, because every column sums to , we have , which means is an eigenvalue of , and therefore also of (a matrix and its transpose share the same characteristic polynomial, because ). Second, applying Gershgorin's theorem to , whose rows are the columns of , places every eigenvalue inside a disc with centre and radius ; every such disc sits inside the unit disc.
The real web, however, is messier than our three-page example: it contains link cycles and isolated pockets of pages from which a surfer cannot escape. The repaired matrix can then fail to be irreducible or can have several eigenvalues of modulus . For instance, a simple cycle of four pages has eigenvalues and , so undamped power iteration on it never settles (Exercise 4). PageRank solves both problems at once by iterating the damped matrix
which describes a surfer who follows a random link with probability and teleports to a uniformly random page with probability . Because every entry of is strictly positive, the Perron--Frobenius theorem applies by construction. Better still, Haveliwala and Kamvar (2003) show that , so the error of power iteration shrinks by at least a factor of at every step, no matter how tangled the link graph is. That single bound made web-scale PageRank practical: fifty sweeps cut the error by more than a factor of (), regardless of how many billions of pages are in the graph.
At web scale, is stored sparsely as one entry per link, and the dense matrix is never formed explicitly. For any probability vector (where ), we can evaluate using just one sparse matrix--vector product plus a constant shift. The dead-end repair for pages with no outgoing links is a rank-one term handled in the same way.
21.4.2 Iteration and Stability#
21.4.2.1 The Spectral Radius#
Power iteration singled out one number: the largest eigenvalue modulus. That number is called the spectral radius, , and it governs the long-run growth rate of the powers of a single fixed matrix. Gelfand's formula makes this exact: for every square matrix and every matrix norm,
The easier half of this statement, for every , is Exercise 1.
What Gelfand's formula does not tell us is what happens at any fixed, finite step , and we have already met two matrices where that gap matters. The shear has , yet its powers grow without bound, so does not even keep the iterates bounded. The Jordan block has and must eventually decay to zero, yet its powers climb to norm before turning downward, so does not rule out large transient growth. When, then, do the eigenvalues control every step rather than only the distant limit?
21.4.2.2 Normal Matrices#
Both of our counterexamples, the shear and the Jordan block, are defective: they lack enough eigenvectors to form a basis. Let us go straight to the opposite extreme and consider matrices that admit an orthonormal basis of eigenvectors. Such a matrix acts independently along mutually perpendicular directions, so its eigenvalues ought to tell the whole story at every step.
A real matrix is called normal if it commutes with its transpose, (for a complex matrix, we replace the transpose by the conjugate transpose , requiring ). Symmetric matrices, orthogonal matrices, and the rotation--scaling blocks of Section 21.3.1.6 are all normal. By contrast, our running example is not normal: , whereas . That failure to commute is the reason its iterates spiraled along ellipses rather than circles.
The complex spectral theorem (Horn and Johnson, 2012) characterizes this class completely: a matrix is normal if and only if it has an orthonormal eigenbasis over , meaning with unitary (). The proof follows the same inductive argument as the real spectral theorem in Section 21.3.2.1.
To measure the worst-case amplification in a single step, write for the spectral norm of , the largest factor by which can stretch a vector. Because a unitary change of basis preserves Euclidean lengths, every power of a normal matrix satisfies
For a normal matrix, the eigenvalues control the worst-case amplification at every single step , not just asymptotically.
What happens when is diagonalizable, , but not normal? Now the eigenvector matrix is no longer orthogonal, and submultiplicativity of the spectral norm gives only the upper bound
The prefactor is the condition number (Section 21.5.3.2) of the eigenvector matrix. It equals when the eigenvectors are orthogonal, and grows arbitrarily large when two eigenvectors point in nearly the same direction. The transient growth it permits has a clean geometric cause: cancellation. When eigenvectors are nearly parallel, an ordinary unit vector can only be expressed as a combination of huge eigen-components that nearly cancel each other out. As we apply repeatedly, those components decay at different rates, the delicate cancellation comes undone, and the iterate balloons in length before the common exponential decay finally takes over.
21.4.2.3 Transient Growth#
The simplest matrix that displays this transient growth is the upper-triangular matrix
Its eigenvalues are its diagonal entries and . Both lie safely inside the unit circle, and because they are distinct, is diagonalizable. Let us compute its eigenvectors by hand and expand the unit vector in them. For , the second row of reads , giving . For , the first row of reads , giving . Notice how close these two directions are: the angle between them is only . Expanding in this nearly parallel basis gives , and applying the eigenvector power expansion (Section 21.3.1.3) yields
At , a vector of length is formed as the difference of two eigen-components of length roughly . Both components decay at every step, yet because falls faster than , their cancellation unravels and the sum initially grows. The first coordinate peaks where its derivative with respect to vanishes, namely where , which occurs at with a height of about . Figure 21.4.3 illustrates the two components at and at . For comparison, the general bound (21.4.4) with unit eigenvectors has and predicts . The bound holds, though it is conservative by a factor of four compared with the true peak of .
Growth of before decay. Left: at , the unit vector is the difference of two eigen-components of length about 40 that nearly cancel. Right: six steps later the two components have decayed by and , breaking the cancellation and producing a vector more than ten times longer. The vertical axis is stretched about 30-fold; drawn to scale, and are only apart.
Let us check this calculation numerically and compare against the diagonal matrix , which has the exact same eigenvalues but is normal.
M = np.array([[0.9, 4.0], [0.0, 0.8]])
Lam = np.diag([0.9, 0.8]) # same eigenvalues, normal
lam, V = np.linalg.eig(M) # unit eigenvectors as columns
print('eigenvalues:', lam)
print('coefficients of e_2 on the unit eigenvectors:',
np.linalg.solve(V, [0., 1.]))
ks = np.arange(61)
norm_M = [np.linalg.norm(np.linalg.matrix_power(M, k), 2) for k in ks]
norm_L = [np.linalg.norm(np.linalg.matrix_power(Lam, k), 2) for k in ks]
k_peak = int(np.argmax(norm_M))
print(f'max ||M^k|| = {norm_M[k_peak]:.3f} at k = {k_peak}; '
f'max ||Lambda^k|| = {max(norm_L):.3f}')
print(f'kappa_2(V) = {np.linalg.cond(V):.1f}')
eigenvalues: [0.9 0.8]
coefficients of e_2 on the unit eigenvectors: [40. 40.01249805]
max ||M^k|| = 10.788 at k = 6; max ||Lambda^k|| = 1.000
kappa_2(V) = 80.0
Expressed in the unit eigenvectors, carries two coefficients of magnitude about , matching the lengths of and . The spectral norm climbs to at , whereas never exceeds its starting value of . Even though both matrices share the same eigenvalues, the normal matrix contracts from the very first step while the non-normal matrix grows more than ten-fold before decaying. The left panel of Figure 21.4.4 plots both trajectories on a logarithmic scale; past the peak, both curves eventually descend with the same slope , just as Gelfand's formula guarantees.
Left: and for the same eigenvalues 0.9 and 0.8; climbs to 10.8 at before both curves decay with slope . Right: the -pseudospectra for ; around the normal matrix they are simply discs of radius , whereas around they bulge far past the unit circle.
21.4.2.4 Pseudospectra#
This subsection adds a diagnostic for non-normality rather than a new phenomenon, and may be skipped on a first pass. Beyond transient growth, a second symptom of non-normality is extreme sensitivity of the eigenvalues to small perturbations. To make that sensitivity visible, the -pseudospectrum collects every complex number that becomes an eigenvalue of for some perturbation of spectral norm at most . Conveniently, the same set can be computed directly from the resolvent :
where the resolvent norm is taken to be infinite at the eigenvalues of itself. Proving the equivalence of these two descriptions is Exercise 3. For a normal matrix, the resolvent norm at is simply the reciprocal of the distance from to the nearest eigenvalue, so is just the union of discs of radius around the eigenvalues. For a non-normal matrix like , the resolvent norm can be vastly larger, as we can check at on the unit circle.
I = np.eye(2)
print(f'||(I - M)^-1|| = {np.linalg.norm(np.linalg.inv(I - M), 2):.1f}')
print(f'||(I - Lambda)^-1|| = {np.linalg.norm(np.linalg.inv(I - Lam), 2):.1f}')
||(I - M)^-1|| = 200.3
||(I - Lambda)^-1|| = 10.0
For the resolvent norm is , the reciprocal of the distance from to the eigenvalue . For it jumps to : a tiny perturbation of size already pushes an eigenvalue of onto the unit circle, whereas requires a perturbation twenty times larger, of size (right panel of Figure 21.4.4). Because floating-point rounding acts like a small perturbation to the matrix entries, the numerically computed eigenvalues of a strongly non-normal matrix can be surprisingly inaccurate. Section 21.6 follows this thread further with the Kreiss matrix theorem.
21.4.2.5 Products of Jacobians#
So far we have multiplied a vector by the same matrix repeatedly. Recurrent neural networks (Section 8.5) break even that assumption. A recurrent layer updates its hidden state as , using the same weight matrix at every step, yet backpropagation through time multiplies the gradient by the sequence of per-step Jacobians :
Because the nonlinearity is evaluated at a different hidden state at each time step, the Jacobians are different matrices, and the theory of powers of a single matrix no longer applies.
In fact, the spectral radii of the individual factors tell us nothing at all about their product. Consider the two matrices
Both and are nilpotent with , so every power of either matrix vanishes by the second step. Yet their product has : copies the second coordinate into the first while doubling it, and copies it straight back while doubling it again.
It is therefore helpful to keep three distinct quantities straight when studying iterated linear maps. The spectral radius gives the asymptotic growth rate of powers of one fixed matrix. The spectral norm bounds any finite product of changing matrices, because submultiplicativity gives (in our example, ). Finally, the top Lyapunov exponent
measures the average logarithmic growth rate per step along a long product of changing matrices. When the factors are independent and identically distributed random matrices, this limit exists with probability one under mild conditions (Furstenberg and Kesten, 1960).
When a gradient passes backward through a sequence of Jacobians with , it grows exponentially and explodes; when , it shrinks exponentially and vanishes (Bengio et al., 1994; Pascanu et al., 2013). Notice that the standard remedies in deep learning target norms and Jacobians rather than eigenvalues. Orthogonal initialization (Saxe et al., 2014) chooses an orthogonal weight matrix so that a linear recurrence preserves the Euclidean length of every vector at every step, a much stronger guarantee than . Gradient clipping caps the norm of the gradient directly after backpropagation. Gated architectures such as LSTMs and GRUs alter the Jacobians themselves, creating pathways along which selected directions pass through with factors close to (Section 8.5.1.1).
21.4.2.6 Random Matrices at Initialization#
How large are the spectral radius and spectral norm for the random weight matrices of a freshly initialized neural network? Consider an matrix with independent standard Gaussian entries, known as the real Ginibre ensemble (Ginibre, 1965). As , the eigenvalues rescaled by spread uniformly over the unit disc in the complex plane. This is the circular law, which Tao and Vu (2010) proved in general for independent, identically distributed entries of mean and variance . The circular law tells us where almost all eigenvalues live, though by itself it does not rule out a few stray outliers. A separate theorem establishes that no outlier escapes the unit circle, so with probability one (Geman, 1986).
The spectral norm behaves quite differently: (Yin et al., 1988). This is a special case of the Marchenko--Pastur law (Section 21.3.2.4) at aspect ratio : the largest eigenvalue of converges to the upper edge , and is simply times that eigenvalue. Even at , a single random draw sits right next to both asymptotic limits.
n = 1000
A = np.random.randn(n, n)
print(f'rho(A) / sqrt(n) = {np.abs(np.linalg.eigvals(A)).max() / n ** 0.5:.3f}')
print(f'sigma_max(A) / sqrt(n) = {np.linalg.norm(A, 2) / n ** 0.5:.3f}')rho(A) / sqrt(n) = 1.030
sigma_max(A) / sqrt(n) = 1.990
At large , the spectral radius lands within a few percent of while the largest stretch sits close to : a random Gaussian matrix stretches certain vectors twice as far as its eigenvalues would lead you to expect. Standard initialization schemes divide random weights by for a different reason altogether. With entries of variance , we get for every fixed vector , so squared lengths are preserved on average. Having a spectral radius near is merely a side effect, and as Section 21.4.2.5 showed, it does not control a product of different matrices. Surprisingly, a long product of independent matrices with this exact scaling shrinks a typical vector, giving , even though every individual factor preserves squared length on average. The reason is the concavity of the logarithm: for a unit vector , the expectation of lies strictly below the logarithm of the expectation of (which is ), and it is the logarithms that add up along a deep product (Exercise 5).
Both the non-normal matrix and the random Gaussian matrix point to the same conclusion: eigenvalues tell us little about how much a matrix stretches vectors over a finite number of steps, and for rectangular matrices eigenvalues do not even exist. To measure stretching directly, for any matrix of any shape, we turn next to the singular values of Section 21.5.
21.4.3 Summary#
Even without factoring a matrix, Gershgorin discs locate its eigenvalues directly from its entries, and power iteration extracts the dominant eigenpair at the geometric rate , the mechanism behind PageRank. The spectral radius governs the long-run rate of powers of a single fixed matrix and nothing more: a non-normal matrix can grow dramatically before it decays, and the eigenvalues of individual factors reveal nothing about a product of changing matrices. For products of changing maps, the spectral norm bounds finite steps and the top Lyapunov exponent gives the average long-run rate. A random Gaussian matrix at initialization makes the gap between eigenvalues and stretching concrete: its spectral radius is close to , whereas its spectral norm is close to .
21.4.4 Exercises#
-
Spectral radius and norms. The spectral radius bounds every power of a matrix from below, and for normal matrices it also bounds them from above.
- Show that for every square matrix and every .
- The chain (21.4.3) uses two facts without proof. Show that for every unitary and every square , and that the spectral norm of a diagonal matrix is the largest modulus of its diagonal entries.
- Show that the converse of (21.4.3) fails: find a matrix that is not normal but satisfies for every .
- For a given , construct a diagonalizable matrix with spectral radius and .
-
[code] Power-iteration rates. Let be the matrix of Figure 21.4.2.
- By (21.4.2), the misalignment between the iterate and decays at the rate . How many iterations reduce it by a factor of ?
- Let be symmetric with unit eigenvector for , and let for a unit vector orthogonal to . Show that the Rayleigh quotient of Section 21.3.2.3 satisfies , with no term linear in . At which rate does the Rayleigh quotient of the power iterates therefore approach ? Where does the argument use that is symmetric?
- Repeat the experiment of Figure 21.4.2 for , which has the same eigenvectors as and the eigenvalues 1.1 and 0.9, from a random start. Plot the sine of the angle to and the error of the Rayleigh quotient on a logarithmic scale for 30 steps. Predict both slopes and the number of steps each error needs to shrink by a factor of 100, and explain why this matrix converges so much more slowly than .
-
[code] Pseudospectra and transient growth. ● Let be the non-normal matrix (21.4.5) and the normal matrix with the same eigenvalues, as in Section 21.4.2.3.
- Prove the equality of the two sets in (21.4.7). First show that , where . For one inclusion, take unit vectors , with , , and show that is an eigenvalue of . For the other, apply to an eigenvector of . Using the resolvent norms printed in Section 21.4.2.4, how large a perturbation makes an eigenvalue of a perturbed , and how large for ?
- Suppose that for all . Show that for the series converges to , and conclude that
The quantity is called the Kreiss constant. Restate the bound in terms of pseudospectra: if contains a point at distance outside the unit circle, how large must some power of be?
- Evaluate numerically on a grid of points with , and compare it with the largest printed in Section 21.4.2.3. Find by hand.
-
[code] Damping in PageRank. ● Let be a column-stochastic matrix and with , the damped matrix of Section 21.4.1.3.
- Let . Show that whenever , and that whenever .
- The eigenvalue of can be repeated, as it is when the links split into disconnected pockets. You may use that every column-stochastic has a non-negative eigenvector for the eigenvalue 1 (a stationary distribution). Show that the vectors of this eigenspace with form a subspace of dimension one less than the eigenspace. Conclude that for diagonalizable the eigenvalues of are and , which gives the bound of Haveliwala and Kamvar (2003).
- Four pages link in a cycle, . Find the eigenvalues of their link matrix . Why does undamped power iteration started at page never converge?
- With and the cycle of (c), run power iteration on from page , and count the iterations until the distance to the stationary distribution falls below . Compare with the prediction from (b).
- Check numerically on the three-page example of Section 21.4.1.3 that the eigenvalues of are times those of , apart from the eigenvalue 1, and that the stationary distribution moves from to about . Why does damping move it toward uniform?
-
[code] Lyapunov exponents of random products. ●● Let be independent matrices with independent entries, a linear model of the Jacobians of a deep network at fan-in initialization, and let be a unit vector. By Section 21.4.2.6, each factor has spectral radius close to for large . Section 21.4.2.5 summarizes the growth of the product by its top Lyapunov exponent
which exists with probability one by the theorem of Furstenberg and Kesten.
- Show that for every fixed , so that this scaling preserves squared norms on average.
- Let and for the iterates . Given , what is the distribution of ? Use the answer to write as a sum of independent terms. With , where is the digamma function, derive the closed form of Cohen and Newman (1984)
- Show that for every , although (a) holds. Evaluate in closed form for , using with Euler's constant . Using , show that for large .
- Simulate steps with renormalization for , and compare the measured exponent with (b) and with the logarithms of the spectral radius and of the largest singular value of single factors. By which factor does a typical input shrink in a linear network of width and depth at this initialization? What does the comparison say about the three quantities of Section 21.4.2.5?