ℹ

Lloyd-Max Algorithm

Definition (Lloyd-Max Quantizer)

We say that a quantizer satisfies the Lloyd-Max conditions if it satisfies both the NNC and CC. This quantizer is called a Lloyd-Max quantizer.

Note

optimal quantizer  ⟹  NNC+CC\text{optimal quantizer}\implies \text{NNC}+\text{CC}

First we define the Lloyd Iteration:

Lloyd Iteration

  1. Given Cm={y1(m),…,yN(m)}\mathcal{C}_{m}=\{ y_{1}^{(m)},\dots,y_{N}^{(m)} \}, use the NN condition to form the optimal partition Ri(m)={x:d(x,yi(m))≤d(x,yjm), j=1,…,N}  i=1,…,N(*)\tag{*}R_{i}^{(m)}=\{ x:d(x,y_{i}^{(m)})\le d(x,y_{j}^{m}), \ j=1,\dots,N \} \ \ i=1,\dots,N

  2. Determine Cm+1={y1(m+1),…,yN(m+1)}\mathcal{C}_{m+1}=\{ y_{1}^{(m+1)},\dots,y_{N}^{(m+1)} \} using the centroid condition yi(m+1)=arg⁡min⁡y∈R E[d(X,y)∣X∈Ri(m)], i=1,…,Ny_{i}^{(m+1)}=\underset{y\in\mathbb{R}}{\arg\min} \ E[d(X,y)|X\in R_{i}^{(m)}], \ i=1,\dots,N Now we have enough to state the Lloyd-Max algorithm

    Algorithm

  3. Inputs: pdf f(x)f(x), initial codebook C1={y1(1),…,yN(1)}\mathcal{C}_{1}=\{ y_{1}^{(1)},\dots,y_{N}^{(1)} \}, threshold ϵ>0\epsilon>0. Set m=1m=1 and D1=E[d(X,Q(1)(X))]D_{1}=E[d(X,Q^{(1)(X)})].

  4. Given Cm\mathcal{C}_{m}, perform the Lloyd Iteration to get Cm+1\mathcal{C}_{m+1}

  5. Compute Dm+1=E[d(X,Q(m+1)(X))]D_{m+1}=E[d(X,Q^{(m+1)}(X))] If Dm−Dm+1Dm<ϵ\frac{D_{m}-D_{m+1}}{D_{m}}<\epsilonthen output Cm+1\mathcal{C}_{m+1} and stop. Otherwise m:=m+1m:=m+1 and go step 22.

Remarks

  • Lloyd iteration either reduces distortion or leaves it unchanged, i.e. it is non-increasing, and DmD_{m} converges to a limit as m→∞m\to \infty. Hence lim⁡m→∞Dm−Dm+1Dm=0\lim_{ m \to \infty } \frac{D_{m}-D_{m+1}}{D_{m}}=0
  • It is not guaranteed Cm\mathcal{C}_{m} converges.
  • If Cm\mathcal{C}_{m} converges it is not guaranteed that our “limit quantizer” will be optimal.

Linked from