Before this lesson:lesson 08 (the SVD, Eckart–Young–Mirsky, polar
decomposition and the pseudoinverse) and lesson 03
(inverse, determinant, dot product and orthogonal projection).
Time: about 70 minutes, plus the notebook.
A norm is a choice of how to measure size, and the choice changes the answer. Penalizing
∥w∥1 gives sparse models (lasso); penalizing ∥w∥22 gives small, dense ones
(ridge). For matrices, the spectral norm measures the worst-case stretch: it is the
Lipschitz constant of a linear layer and the basis of spectral normalization. The nuclear
norm is the convex stand-in for rank, used for matrix completion and low-rank recovery.
Error budgets for compression (lesson 08) and condition numbers (lesson 13) are also
stated in these norms.
The unit ball of a norm is the set {x:∥x∥≤1}. In the plane it looks like this:
ℓ2: a disk.
ℓ1: a diamond with corners on the axes, (±1,0) and (0,±1).
ℓ∞: a square with corners at (±1,±1).
Interactive figure: loading…
Change p and watch the ball. The green region is the unit ball of
∥⋅∥p; the thin outlines are the ℓ1, ℓ2 and
ℓ∞ balls. As p grows, the ball grows from the diamond to the
square. Move p below 1: the ball becomes a star, and the midpoint of
e1 and e2 falls outside it. A set that does not contain the midpoints of its points is not
convex, so for p<1 the formula is not a norm. Drag x to see
∥x∥∞≤∥x∥2≤∥x∥1.
To find the point of a line with the smallest norm, inflate the ball until it first
touches the line. The disk touches at the foot of the perpendicular, which in general has
no zero coordinate. The diamond almost always touches first at a corner, and corners lie
on the axes: one coordinate is exactly zero. This one picture is the main reason why ℓ1
gives sparse solutions.
Interactive figure: loading…
Inflate the balls. Press Inflate to grow the ℓ1,
ℓ2 and ℓ∞ balls until each touches
the line x1+2x2=4 of section 1. The touching points are the minimizers. Drag the grey
points to tilt the line: the ℓ1 answer jumps from one axis to the other but always keeps a
zero coordinate, while the ℓ2 answer moves smoothly and has no zeros.
For a matrix A, the singular values σ1≥σ2≥⋯≥0 are the axis
lengths of the ellipse {Ax:∥x∥2=1} (lesson 08). The three main matrix norms are
three ways to summarize these lengths: the longest one, the root of the sum of squares,
and the sum.
Quick check
For x=(3,4), which list gives ∥x∥∞,∥x∥2,∥x∥1 in this order?
Why.
∥x∥∞=max(∣3∣,∣4∣)=4,∥x∥2=9+16=5 and ∥x∥1=3+4=7. The order ∥x∥∞≤∥x∥2≤∥x∥1 always holds: the ball of ℓ1 is inside the ball of ℓ2, which is inside the ball of ℓ∞. The value 3 is the smallest entry, not the largest, and 12 is the product, which is not a norm.
A norm on Rn is a function ∥⋅∥ with, for all x,y and scalars c:
∥x∥≥0, and ∥x∥=0 only for x=0 (definiteness);
∥cx∥=∣c∣∥x∥ (homogeneity);
∥x+y∥≤∥x∥+∥y∥ (triangle inequality).
The ℓp norms, for p≥1:∥x∥p=(∑i∣xi∣p)1/p, and
∥x∥∞=maxi∣xi∣ (the limit p→∞). Facts you will use:
∥x∥p is non-increasing in p:∥x∥∞≤∥x∥2≤∥x∥1.
In the other direction: ∥x∥1≤n∥x∥2 and ∥x∥2≤n∥x∥∞.
A bound used below: ∣a⊤x∣≤∥a∥∞∥x∥1. Proof:
∣∑iaixi∣≤∑i∣ai∣∣xi∣≤maxi∣ai∣∑i∣xi∣.
For a symmetric positive definite (SPD) matrix S,∥x∥S=x⊤Sx is also a norm
(the energy norm).
Not norms. For 0<p<1 the triangle inequality fails: with x=(1,0),y=(0,1),∥x+y∥1/2=(1+1)2=4>2=∥x∥1/2+∥y∥1/2; the unit ball is not convex.
The count of nonzeros, "∥x∥0", fails homogeneity: ∥2x∥0=∥x∥0, not 2∥x∥0.
Dual norms and Hölder's inequality
Hölder's inequality:∣x⊤y∣≤∥x∥p∥y∥q when 1/p+1/q=1 (with 1/∞=0).
For p=q=2 it is the Cauchy–Schwarz inequality. For p=1,q=∞ it is the bound
∣a⊤x∣≤∥a∥∞∥x∥1 above.
The dual norm of a norm ∥⋅∥ is ∥y∥∗=max∥x∥≤1x⊤y: the largest
"score" x⊤y over the unit ball. Hölder's inequality is sharp, so the dual of ℓp is
ℓq. So ℓ1 and ℓ∞ are dual to each other, and ℓ2 is its own dual.
For ℓ1 the maximizer of x⊤y over the unit ball is a corner ±ej with
j=argmaxi∣yi∣, so max∥x∥1≤1x⊤y=∥y∥∞. This is the same
"corner" picture as in section 2. Dual norms appear in optimality conditions (the subgradient of
∥x∥ is a vector of dual norm at most 1) and in steepest descent: the steepest-descent step in
ℓ∞ is −sign(∇f), the step of signSGD and close to Adam's early steps.
Theorem 1 (one constraint). Let a=0. Among all x with a⊤x=b, the
smallest ℓ1 norm is ∣b∣/∥a∥∞, reached by the 1-sparse vector
x=(b/aj)ej with j=argmaxi∣ai∣. The smallest ℓ2 norm is reached at
x=ba/∥a∥22, which (for b=0) is nonzero wherever a is.
Proof.
By the bound above, ∣b∣=∣a⊤x∣≤∥a∥∞∥x∥1. So every feasible x
has ∥x∥1≥∣b∣/∥a∥∞.
x=(b/aj)ej is feasible (a⊤x=aj⋅b/aj=b) and has
∥x∥1=∣b∣/∣aj∣=∣b∣/∥a∥∞: the lower bound is reached.
For ℓ2, the minimizer is the orthogonal projection of 0 onto the line (lesson 03), which is
along the normal vector a:x=ba/∥a∥22.■
Soft-thresholding. Lasso solvers reduce the problem to one coordinate at a time. For one
coordinate, the question is: given a number z (what the data want) and a penalty weight
λ>0, which x minimizes
g(x)=21(x−z)2+λ∣x∣?
Theorem 2 (soft-thresholding). The minimizer of g is
x⋆=Sλ(z)=sign(z)max(∣z∣−λ,0). The minimizer of the ridge
objective 21(x−z)2+2λx2 is z/(1+λ).
Proof, step by step.g is a parabola plus a "V". Both are convex, so g is convex, and a
point where g stops going down and starts going up is the global minimum. The V has a kink at
x=0, so we look at three cases.
Case x>0. Here ∣x∣=x, so g(x)=21(x−z)2+λx and
g′(x)=x−z+λ. Setting g′(x)=0 gives x=z−λ. This point is in the case
(x>0) only when z>λ.
Case x<0. Here ∣x∣=−x, so g′(x)=x−z−λ, and g′(x)=0 gives
x=z+λ. This point is in the case (x<0) only when z<−λ.
Case x=0 (the kink).g has no derivative at 0, but it has two one-sided slopes:
g′(0−)=−z−λ from the left and g′(0+)=−z+λ from the right. The point
x=0 is the minimum when g goes down into it and up after it:
g′(0−)≤0≤g′(0+), that is, −λ≤z≤λ.
The three conditions z>λ,z<−λ and ∣z∣≤λ cover every z exactly
once. Together: x⋆=z−λ,z+λ or 0, which is the formula
sign(z)max(∣z∣−λ,0).
Ridge. The ridge objective has no kink: its derivative x−z+λx=0 gives
x=z/(1+λ), which is zero only if z=0.■
In the language of convex analysis, step 3 says 0∈−z+λ∂∣x∣(0), where the
subdifferential∂∣x∣(0)=[−1,1] is the set of slopes of lines that touch the V at 0
from below.
Interactive figure: loading…
Move z and λ. Top: the lasso objective g with its minimizer,
the ridge objective with its minimizer, and the
two slopes of g at the kink. Bottom: the output x⋆ against the input
z. Move z into the band −λ≤z≤λ: the left slope becomes ≤0 and the right
slope ≥0, so the lowest point of g sits exactly at the kink and the lasso output is
exactly 0. The ridge output z/(1+λ) only gets smaller.
The reason in one sentence: ∣x∣ keeps slope ±1 near 0, so a small data term cannot pull
x away from 0; x2 has slope 0 at 0, so it never holds x exactly at 0 (unless
z=0). Lasso solvers (ISTA, coordinate descent) apply this step to each coordinate.
Quick check
With λ=1, what does soft-thresholding give for z=0.7 and for z=−2.5?
Why.
∣0.7∣≤λ, so the output is exactly 0. For z=−2.5<−λ the output is z+λ=−1.5: soft-thresholding moves z toward 0 by λ and stops at 0. Dividing by 1+λ is the ridge rule. The value −0.3 comes from subtracting λ without the sign rule; −3.5 moves away from 0.
The same picture works for a full least-squares loss. Lasso and ridge can be written as
constrained problems: minimize ∥Xw−y∥22 subject to ∥w∥1≤t or ∥w∥2≤t
(each value of the penalty λ matches some radius t). The level sets of the loss are
ellipses around the unconstrained solution w^.
Interactive figure: loading…
Where the ellipse meets the ball. The grey ellipses are level sets of the least-squares loss
around w^. The solution under a constraint is the point where the smallest ellipse reaches
the diamond (lasso) or the disk (ridge). Drag
w^ around: for a large range of positions the lasso answer sits on a corner, with one weight
exactly 0, while the ridge answer only shrinks. Make t large enough and both answers equal
w^. The tilt slider turns the ellipses (correlated features).
The spectral norm is the largest stretch factor of A. The Frobenius norm treats A as a
long vector of mn entries. The nuclear norm is the sum of the singular values.
Theorem 3.∥A∥2=σ1 and ∥A∥F2=∑iσi2.
Proof.
Orthogonal matrices keep lengths. Put y=V⊤x, so ∥y∥=∥x∥, and
∥Ax∥=∥UΣy∥=∥Σy∥.
∥Σy∥2=∑iσi2yi2≤σ12∥y∥2. So ∥Ax∥/∥x∥≤σ1.
Equality at x=v1:Av1=σ1u1. Hence ∥A∥2=σ1.
∥A∥F2=tr(A⊤A)=tr(VΣ⊤ΣV⊤)=tr(Σ⊤ΣV⊤V)=∑iσi2 (the trace is cyclic:
tr(XY)=tr(YX)).■
Any vector norm gives an induced (operator) matrix norm: ∥A∥p=maxx=0∥Ax∥p/∥x∥p,
the largest stretch measured in ℓp. For p=2 this is σ1, which needs the SVD.
For p=1 and p=∞ there are simple formulas.
∥A∥1 = largest absolute column sum. Let cj=∑i∣aij∣ be the absolute sum of column j.
Step 1: use ∣a+b∣≤∣a∣+∣b∣ inside, then swap the order of the two sums.
Step 2: bound every cj by the largest one.
Step 3: equality holds at x=ej for the best column j, because ∥Aej∥1=cj.
So ∥A∥1=maxjcj.
∥A∥∞ = largest absolute row sum. Let ρi=∑j∣aij∣ be the absolute sum of row i.
Step 1: bound each entry of Ax.
∣(Ax)i∣=j∑aijxj≤j∑∣aij∣∣xj∣≤ρi∥x∥∞.
Step 2: take the largest entry: ∥Ax∥∞=maxi∣(Ax)i∣≤(maxiρi)∥x∥∞.
Step 3: equality holds at xj=sign(aij) for the best row i. Then every term
is aijxj=∣aij∣, so (Ax)i=ρi, and ∥x∥∞=1.
Example.A=(13−24).
Column sums: ∣1∣+∣3∣=4 and ∣−2∣+∣4∣=6. So ∥A∥1=6, reached at e2:Ae2=(−2,4) and ∥Ae2∥1=6.
Row sums: ∣1∣+∣−2∣=3 and ∣3∣+∣4∣=7. So ∥A∥∞=7, reached at the signs of
row 2, x=(1,1):Ax=(−1,7) and ∥Ax∥∞=7.
Interactive figure: loading…
The largest stretch. The grey region is the unit ball of ∥⋅∥p and the green
region is its image under A. The dashed ball has radius ∥A∥p: it is the smallest p-ball
around the image, and it touches the image at Ax⋆. For p=1 the
maximizer x⋆ is a corner ej (largest column sum); for p=∞ it is a
corner (±1,±1) (the signs of the largest row); for p=2 it is
v1. The matrix is half of the one in section 4, so every norm is half as large.
The Frobenius and nuclear norms are not induced norms: every induced norm has
∥I∥=maxx∥x∥/∥x∥=1, but ∥In∥F=n and ∥In∥∗=n.
Quick check
What is the spectral norm ∥A∥2 of A=(300−5)?
Why.
A sends e2 to −5e2, a stretch by 5, and no unit vector is stretched more. The singular values are ∣3∣ and ∣−5∣, so σ1=5. The largest signed entry is 3, so "largest entry" is wrong even here. 34=9+25 is the Frobenius norm and 8=3+5 is the nuclear norm.
Useful properties:
Unitary invariance:∥QAZ∥=∥A∥ for orthogonal Q,Z, for all three norms
(the singular values do not change).
Inequalities (vector norm inequalities applied to σ∈Rr):∥A∥2≤∥A∥F≤r∥A∥2 and ∥A∥F≤∥A∥∗≤r∥A∥F.
Submultiplicativity:∥AB∥≤∥A∥∥B∥ for induced norms and for Frobenius; also
the mixed bound ∥AB∥F≤∥A∥2∥B∥F.
A function f is L-Lipschitz if ∥f(x)−f(y)∥≤L∥x−y∥ for all x,y: outputs
move at most L times as much as inputs. The smallest such L is the Lipschitz constantLip(f). Here we build the bound for a network step by step.
A linear layer.∥Wx−Wy∥2=∥W(x−y)∥2≤∥W∥2∥x−y∥2, with equality when
x−y is parallel to v1. So Lip(x↦Wx)=σ1(W) exactly.
An activation. ReLU acts entry by entry, and ∣max(a,0)−max(b,0)∣≤∣a−b∣ for numbers.
Square and add over the entries: ReLU is 1-Lipschitz. The same holds for tanh.
A composition. If g is Lg-Lipschitz and h is Lh-Lipschitz, then
∥h(g(x))−h(g(y))∥≤Lh∥g(x)−g(y)∥≤LhLg∥x−y∥.
A network. For f=WL∘ϕ∘⋯∘ϕ∘W1 with 1-Lipschitz
activations ϕ, step 3 applied layer by layer gives Lip(f)≤∏l∥Wl∥2.
A 2-layer example. Let W1=(2001/2),W2=(1/2002) and f(x)=W2ReLU(W1x).
The bound is ∥W2∥2∥W1∥2=2⋅2=4. But W1 stretches the e1 direction by 2 and
W2 shrinks the same direction by 1/2, so f(x)=(ReLU(x1),ReLU(x2)),
and the true constant is 1. With W2=W1 instead, f(x)=(4ReLU(x1),41ReLU(x2)):
two points on the positive x1-axis move 4 times apart, so the bound 4 is reached. The product
bound is tight only when the top directions of consecutive layers line up.
Spectral normalization (Miyato et al., 2018) uses W/σ^1(W) in each layer, so
every layer is (up to the estimation error of σ^1) 1-Lipschitz and the bound is
at most 1. The estimate σ^1 comes from one power-iteration step per training step,
reusing the vector from the previous step. Two limits: the product bound is often loose (as in
the example), and for a convolution the paper normalizes the reshaped
dout×(dinhw) kernel matrix, which is only a proxy for the operator norm of
the convolution.
rank(A) is the number of nonzero σi (an "ℓ0" of σ), while
∥A∥∗ is the ℓ1 norm of σ. So the nuclear norm plays the role of ℓ1 for rank.
Why not minimize the rank directly? The rank is not a convex function. A convex f satisfies
f(21A+21B)≤21f(A)+21f(B). Take A=E11=diag(1,0)
and B=E22=diag(0,1). Each has rank 1, but 21A+21B=21I
has rank 2>21⋅1+21⋅1=1. Problems like "find the matrix of smallest rank
that fits these entries" are NP-hard in general. The nuclear norm is a norm, so it is convex:
here ∥21I∥∗=1=21∥A∥∗+21∥B∥∗, and convex problems with it can be
solved efficiently.
Quick check
A=diag(1,0) and B=diag(0,1). Which statement is true?
Why.
21A+21B=21I has two nonzero singular values, so its rank is 2, which breaks the convexity inequality. Its nuclear norm is 21+21=1, which satisfies it. The rank equals the nuclear norm only when all nonzero singular values are 1 (for example, for an orthogonal projection).
The proximal step of the nuclear norm (the matrix version of soft-thresholding) is
singular value soft-thresholding: UΣV⊤↦Umax(Σ−λ,0)V⊤. It sets
the small singular values exactly to zero, so it gives low rank in the same way that
soft-thresholding gives zeros. On the set {∥A∥2≤1},∥A∥∗ is the convex envelope
(the largest convex function below) of the rank (Fazel), which is why it is the standard convex
surrogate (matrix completion, robust PCA).
They are norms for p≥1 (the triangle inequality needs a real proof, via von
Neumann's trace inequality); for 0<p<1 they are not (non-convex rank surrogates).
All are unitarily invariant, and non-increasing in p.
Eckart–Young–Mirsky holds in every unitarily invariant norm: the truncated SVD Ak is
the best approximation of rank at most k in every Sp, with error
(∑j>kσjp)1/p.
Duality of the Schatten norms
Sp and Sq are dual for 1/p+1/q=1:∥A∥Sq=max∥B∥Sp≤1tr(B⊤A),
with the matrix inner product tr(B⊤A)=∑ijbijaij. So the nuclear
and the spectral norm are dual (this is the definition of ∥A∥∗ in the table), and Frobenius is
self-dual. The maximizer for the nuclear norm is B=UV⊤ (the orthogonal factor of the polar
decomposition, lesson 08): tr(VU⊤UΣV⊤)=trΣ=∑iσi.
The proof of the general case uses von Neumann's trace inequality
∣tr(B⊤A)∣≤∑iσi(A)σi(B) and then Hölder's inequality for the
singular value vectors.
Answers to section 1. (1) ℓ2:(0.8,1.6), no zero. ℓ1:(0,2), by
Theorem 1 (∥a∥∞=2 at j=2). (2) All three are equal: a rank-one matrix has one
nonzero singular value, σ1=∥u∥2∥v∥2.
Minimum norms on the line x1+2x2=4(a=(1,2),b=4; the second figure):
Norm
Minimizer
Why
ℓ2
ba/∥a∥2=(0.8,1.6)
projection; norm 4/5≈1.789
ℓ1
(0,2)
corner of the diamond; ℓ1 norm 2 (the ℓ2 answer has 2.4)
ℓ∞
(4/3,4/3)
corner of the square: equal coordinates
Soft-thresholding with λ=1:z=(3,0.5,−1.5)↦(2,0,−0.5). The first entry
is in case 1 (3>1, so 3−1), the second in case 3 (∣0.5∣≤1, so 0), the third in case 2
(−1.5<−1, so −1.5+1). Ridge with λ=1 gives z/2=(1.5,0.25,−0.75): smaller,
but no zeros.
A matrix.A=(3405).A⊤A=(25202025) has eigenvalues 45 and 5, so
σ1=35≈6.708 and σ2=5≈2.236 (check:
σ1σ2=15=∣detA∣).
Spectral: ∥A∥2=35≈6.708, reached at v1=(1,1)/2:Av1=(3,9)/2, length 90/2=45. ✓
Frobenius: 9+16+25=50=45+5≈7.071. ✓
Nuclear: 35+5=45≈8.944.
Schatten-4: (σ14+σ24)1/4=(452+52)1/4=20501/4≈6.729, between S2 and S∞.
Inequalities with r=2:6.708≤7.071≤9.487 and 7.071≤8.944≤10. ✓
Nuclear soft-thresholding with λ=3:σ↦(35−3,0)≈(3.708,0),
a rank-one matrix.
Quick check
For A=(3405),∥A∥∞=9. Which vector x with ∥x∥∞=1 reaches ∥Ax∥∞=9?
Why.
Take the row with the largest absolute sum, row 2 =(4,5), and choose xj=sign(a2j)=(1,1). Then Ax=(3,9). The other choices give Ax=(0,5),(3,4) and (3,−1), with ∞-norms 5, 4 and 3. A single basis vector ej is the maximizer for ∥A∥1, not for ∥A∥∞.
The libraries confirm the numbers. The notebook for this lesson has these cells and the exercises.
importnumpyasnpimporttorchfromsklearn.linear_modelimportLasso,Ridgex=np.array([1.0,-2.0,2.0])print([float(np.linalg.norm(x,p))forpin(1,2,np.inf)])# [5.0, 3.0, 2.0]A=np.array([[3.0,0.0],[4.0,5.0]])print(np.linalg.svd(A,compute_uv=False))# [6.708 2.236] = 3√5, √5print([round(float(np.linalg.norm(A,o)),3)foroin(2,"fro","nuc",1,np.inf)])# [6.708, 7.071, 8.944, 7.0, 9.0]: spectral, Frobenius, nuclear, max column sum, max row sum# The spectral norm is the largest stretch: random directions never beat v1 = (1,1)/√2.rng=np.random.default_rng(0)Z=rng.standard_normal((2,10_000))print((np.linalg.norm(A@Z,axis=0)/np.linalg.norm(Z,axis=0)).max())# just below 6.708# Soft-thresholding versus ridge, lambda = 1z=np.array([3.0,0.5,-1.5])print(np.sign(z)*np.maximum(np.abs(z)-1,0),z/2)# [ 2. 0. -0.5] [ 1.5 0.25 -0.75]# ℓ1 gives exact zeros, ℓ2 does not (3 true nonzeros out of 20).X=rng.standard_normal((50,20))w_true=np.zeros(20)w_true[:3]=[2.0,-3.0,1.5]y=X@w_true+0.1*rng.standard_normal(50)print((Lasso(alpha=0.1).fit(X,y).coef_==0).sum(),# 17: exactly the 17 unused features(Ridge(alpha=1.0).fit(X,y).coef_==0).sum())# 0# Spectral normalization: W / σ̂1, with σ̂1 from one power-iteration step per forward pass.torch.manual_seed(0)layer=torch.nn.utils.parametrizations.spectral_norm(torch.nn.Linear(64,32))xb=torch.randn(8,64)for_inrange(50):# training mode: each call refines σ̂1layer(xb)print(torch.linalg.matrix_norm(layer.weight.detach(),ord=2).item())# ≈ 1.0
Sparse models. Lasso and compressed sensing (exact recovery of a sparse signal from
few random measurements by minimizing ∥x∥1). In science: sparse regression of
governing equations (SINDy), sparse sensor placement.
Low rank. Matrix completion, robust PCA (low rank + sparse), low-rank regularization
of weights. The nuclear norm is the convex tool; LoRA instead bounds the rank
(≤r) by construction.
Lipschitz control. Spectral normalization in GAN discriminators; Lipschitz bounds for
robustness certificates and for stable long rollouts of learned time-stepping models.
Error budgets. Compress a weight matrix to rank k: the spectral error is
σk+1 (worst-case output change for a unit input); the squared Frobenius error
∑j>kσj2 is the mean squared output change E∥(A−Ak)x∥2 for
x∼N(0,I).
Numerical analysis. Condition numbers κ(A)=∥A∥∥A−1∥ and error bounds
(lesson 13); ∥A∥1 and ∥A∥∞ are cheap, ∥A∥2 needs the SVD or power iteration.
Give ∥x∥1,∥x∥2,∥x∥∞ for x=(2,−1,0,2).Answer5,3,2.
A has singular values 4,3,0. Give ∥A∥2,∥A∥F,∥A∥∗ and ∥A∥S3.Answer4;16+9=5;7;(64+27)1/3=911/3≈4.498.
Why is the minimizer of 21(x−z)2+λ∣x∣ exactly zero for ∣z∣≤λ?AnswerAt x=0 the left slope is −z−λ≤0 and the right slope is −z+λ≥0: the convex function goes down into the kink and up after it. In subgradient form: 0∈(x−z)+λ∂∣x∣ at x=0 reads z∈[−λ,λ].
A 3-layer ReLU network has weight matrices with spectral norms 2,0.5,3. Give an
upper bound on its Lipschitz constant (in ℓ2). Is it attained in general?Answer2⋅0.5⋅3=3. Not in general: it needs the top singular directions of consecutive layers to line up, and ReLU to pass them unchanged.
Show ∥A∥2≤∥A∥F≤r∥A∥2, and say when each side is an equality.Answerσ12≤∑i≤rσi2≤rσ12. Left equality iff rank ≤1; right equality iff all r nonzero singular values are equal (e.g. an orthogonal matrix, r=n).
Compute ∥A∥1 and ∥A∥∞ for A=(2−3−10), and give a maximizing x for each.AnswerColumn sums 5 and 1:∥A∥1=5 at x=e1,Ae1=(2,−3). Row sums 3 and 3:∥A∥∞=3, for example at the signs of row 1, x=(1,−1):Ax=(3,−3).
Recall cardsAnswer in your head first, then reveal. Add the cards to your review deck to see them again just before you would forget.
What three rules make a function ∥⋅∥ a norm?
∥x∥≥0 with equality only for x=0;∥cx∥=∣c∣∥x∥;∥x+y∥≤∥x∥+∥y∥.
Why is ∥x∥1/2=(∑i∣xi∣1/2)2 not a norm?
The triangle inequality fails: ∥e1+e2∥1/2=4>2=∥e1∥1/2+∥e2∥1/2. Its unit ball is not convex.
Why does an ℓ1 penalty give exact zeros, while an ℓ2 penalty does not?
∣x∣ has slope ±1 right next to 0, so a small data term cannot move x off 0. x2 has slope 0 at 0, so it only shrinks. In pictures: the ℓ1 ball has corners on the axes.
Give the soft-thresholding formula Sλ(z).
Sλ(z)=sign(z)max(∣z∣−λ,0): the minimizer of 21(x−z)2+λ∣x∣.
Compute S1(z) for z=(3,0.5,−1.5).
(2,0,−0.5).
What is ∥A∥2 in terms of the SVD, and which x reaches it?
∥A∥2=σ1, the largest stretch ∥Ax∥2/∥x∥2, reached at the top right singular vector v1.
Write ∥A∥F2 in three ways.
∑ijaij2=tr(A⊤A)=∑iσi2.
What are the induced norms ∥A∥1 and ∥A∥∞?
∥A∥1 is the largest absolute column sum; ∥A∥∞ is the largest absolute row sum.
What is the nuclear norm, and why is it used?
∥A∥∗=∑iσi, the ℓ1 norm of the singular values. It is the convex surrogate for the rank (matrix completion, robust PCA).
What is the Lipschitz constant of x↦Wx, and what bound holds for a ReLU network?
σ1(W)=∥W∥2. For WL∘ϕ∘⋯∘W1 with ReLU: Lip≤∏l∥Wl∥2, an upper bound that is often loose.
"Why does L1 regularization give sparse solutions?" — Corners of the ℓ1 ball on the
axes; soft-thresholding sets small coefficients exactly to 0; ∣x∣ keeps slope at 0.
"What is the spectral norm and why do we care in deep learning?" — σ1, the maximum
stretch, the Lipschitz constant of a linear layer; spectral normalization, stability.
"Spectral vs Frobenius vs nuclear?" — ℓ∞,ℓ2,ℓ1 of the singular
values: worst case, total energy, convex surrogate for rank.
"Is the Frobenius norm an operator norm?" — No: ∥I∥F=n=1.
Open on YouTube · the player loads from youtube-nocookie.com when you press playOpen on YouTube · the player loads from youtube-nocookie.com when you press play