Exact values where possible; six decimal places otherwise.
STATEMENT
Solve the linear β-VAE exactly, find its rate and distortion, and follow
them as β goes to zero and as β grows past the point where the code is
abandoned.
GIVEN
Centred data whose covariance has eigenvalues
λ1>λ2≥⋯, the top one along u1. One latent
dimension with prior N(0,1), a decoder
x∣z∼N(wz,σ2I) with σ2 fixed, and
an encoder N(m,v) chosen freely for each input. The objective is
the average of Eqlogp(x∣z)−βKL(q∥N(0,1)).
For numbers use the four points of I.12: λ1=4, λ2=1,
σ2=1.
FIND
(a) The best encoder for a given w. (b) The best ∥w∥2.
(c) The rate and the mean squared distortion there. (d) The limits
β→0 and βσ2≥λ1. (e) A table for the four
points at β=0.25, 1, 2 and 4.
STRATEGY
Write a=wTx, r=∥w∥2 and c=r+βσ2.
Optimise the encoder first; what is left depends on w only through
r and its direction.
SOLUTION
(a) For one input, up to terms that do not involve m or v, the
objective is
2σ22am−(m2+v)r−2β(m2+v−1−logv).
Setting the derivatives in m and v to zero,
m=ca,v=cβσ2.
(b) Substituting, the terms in a2 combine to a2/(2σ2c) and
the terms in v to 2βlog(βσ2/c), up to constants.
Averaged over the data, E[a2]=wTSw, which for
a given r is largest, rλ1, when w lies along u1.
What remains is
J(r)=2σ2crλ1−2βlogc+const,
with derivative
J′(r)=2cβ(cλ1−1).
It is positive while c<λ1 and negative after, so
r=max(λ1−βσ2,0).
(c) While the code is in use, c=λ1. Then E[m2]=r/λ1
and v=βσ2/λ1, and the average KL is
R=21(λ1r+βσ2−1−logλ1βσ2)=21logβσ2λ1.
The squared error averages to
trS−2r+(E[m2]+v)r=trS−r, so
D=i>1∑λi+βσ2.
(d) As β→0, r→λ1, the encoder’s variance
βσ2/λ1 goes to zero, the rate grows like
−21logβ without bound, and the distortion falls to
∑i>1λi, the loss of the principal-axis autoencoder of
I.12.T1. The code tends to u1Tx/λ1:
the principal score, scaled to the prior’s unit variance.
As βσ2 rises to λ1, r and R fall to zero and D
rises to trS. For any larger β, J′(r)<0 for
all r≥0: the optimum is w=0, the encoder returns
N(0,1) for every input, and the code is ignored.
(e) With λ1=4, λ2=1 and σ2=1, R=21log(4/β)
and D=1+β:
β
r
v
R
D
0.25
3.75
0.0625
1.386294
1.25
1
3
0.25
0.693147
2
2
2
0.5
0.346574
3
4
0
1
0
5
Answer
m=a/(r+βσ2) and v=βσ2/(r+βσ2);
∥w∥2=max(λ1−βσ2,0) along u1; while in use,
R=21log(λ1/βσ2) and
D=∑i>1λi+βσ2. As β→0, D→∑i>1λi
and R→∞; from βσ2=λ1 on, the code is unused, with
R=0 and D=trS.
Check — sanity
At β=1 the encoder is the exact posterior of (I.13.2), r=3 is
probabilistic PCA’s ∥w∥2, and the objective equals the
log-evidence −3.531024 of every corner. The curve is continuous at the
threshold: 1+4=5=trS.
Where this breaks
The solution needs σ2 fixed. If it is learned, at β=1 it
settles at the average discarded eigenvalue, and a direction collapses
when its eigenvalue does not exceed that. With several latent dimensions
the same threshold applies to each eigen-direction separately.
Variation
At β=8 the code is unused, as at β=4. At β=0.5 the rate
is 21log8=1.039721 and the distortion 1.5. Halving β
always adds 21log2=0.346574 nats to the rate.