• Aucun résultat trouvé

Linear decoding: known covariance matrix

3.3 The Sparse Ternary Codes

3.3.2 Reconstructing from ternary encoded data

3.3.2.2 Linear decoding: known covariance matrix

Here we restrict our decoding to be linear, i.e., consisting only of a projection step. Let us then try to learn this projection matrix from the data, i.e., we are given a training set F = [f1,· · · ,fN]. Furthermore, we assume that the data is (second-order) stationary and for which we can estimate a covariance matrix from F. For high-dimensional data, e.g., images, and particularly when training set size is limited, estimation of a covariance matrix that is also applicable to the test set is very difficult. However, as we will see later, since we will use only the first several eigenvectors which are more robust to estimate, our assumption of availability of the covariance matrix is safe in practice.

Therefore, concretely, assume that CFn1E[FFT] is the covariance matrix of F. We are interested in finding an optimal decoder that provides the best reconstruction given the ternary codes.

Projection: We want the codes x to be as informative as possible, which requires independence (or at least no correlation) among the dimensions. Thus, we perform the PCA transform by choosing A = UTF, where CF = UFΣFUTF is the eigenvalue decomposition of CF.

9Notice however, that this formulation is interesting since, in a way, it is the opposite of compressed sensing. While in compressed sensing, recovery of high-dimensional sparse signals from low-dimensional dense measurements is desired, Eq. 3.30 tries to reconstruct a dense signal from the sparsity pattern of a high-dimensional projection. Therefore, it may be considered as a future direction.

3.3 The Sparse Ternary Codes 61 Therefore, the projected data ˜f ≜Af is de-correlated and its marginal distributions con-verge to Gaussian10for sufficiently largenas ˜Fj ∼ N(0, σj2), where ΣF = diag [σ12,· · · , σn2]T withσi2’s being the eigenvalues of CF, which are decaying in value for the correlated F.

Encoding: When thinking about reconstruction from codes, we should take into account the fact that the dimensions of ˜f have a decaying variance profile and hence different contributions in the reconstruction of f. However, when encoded as in Eq. 3.19, these differences will not be taken into account for reconstruction. Therefore, at this point, it makes sense to improve our encoding by a slight change as in Eq. 3.29, i.e., by weighting the codes with a weighting vectorβ≜[β1,· · ·, βm]T11, whose optimal values should be calculated:

x=Q[f] =ϕλ(Af)⊙β. (3.29)

Decoding (reconstruction): As it was mentioned in section 3.3.2.1, we prefer fast and hence linear decoding for reconstruction ˆf =Q−1[x]. This is done simply using a (back-) projection matrix B as:

ˆf = Bx= Bϕλ(Af)⊙β. (3.30)

The optimal value of B can be learned from the data. In order to facilitate this, we can provide B with the knowledge of the forward projection A. Therefore, for a general (full-rank) A and without loss of generality, we decompose B as B = (ATA)−1ATB, i.e., with the pseudo-inverse of A, and B that leaves the degrees of freedom for training.12 Therefore, the optimization of B is equivalent to the optimization of B as:

B = argmin

B

||F−(ATA)−1ATBX||2F. (3.31) This can easily be re-expressed as:

B= argmin

B

||(ATA)F−ATBX||2F

= argmin

B Trh(AF−BX)TAAT(AF−BX)i

= argmin

B Trh−2AATAFXTB′T + BXXTB′TAATi.

10Note that, according to CLT, the Gaussianity of the marginals of ˜Fdoes not require the Gaussianity ofF, due to the projection step performed. However, the joint distributionp(˜f) is not a (multivariate) Gaussian in General.

11Note that in our general formulation, we have A as anmbynprojection and hencem-dimensional codes.

However, during section 3.3.2.2 and for simplicity of analysis, we assumem=n.

12This decomposition serves us with the facility of presentation, but in general and within iterative procedures, such decompositions can help convergence.

Derivation w.r.t. B and equating to zero gives:

B′∗= AFXT(XXT)−1. (3.32)

Noting that AF = ˜F and X =ϕ(˜F)⊙(β1TN), and by expressing matrix multiplications as the sum of rank-1 matrices, B′∗can be re-written as:

B =hF˜[ϕ(˜F)⊙(β1TN)]Tih[ϕ(˜F)⊙(β1TN)][ϕ(˜F)⊙(β1TN)]Ti−1

=h

N

X

i=1

˜fi[ϕ(˜fi)⊙β]Tih[ββT]

N

X

i=1

ϕfi)ϕfiT)i−1.

As was mentioned earlier, now let us choose A = UTF, i.e., the PCA. Due to the de-correlating property of A, in the projected domain and hence in the code domain, the covariance matrix ϕ(˜F)ϕ(˜F)T and the cross-covariance matrix ˜Fϕ(˜F)T are diagonals. There-fore, the expression of B′∗ above is a product of two diagonals and hence is a diagonal itself.

This is a function only of the weighting vectorβ. This means that, in our encoding-decoding formulation and their optimization to minimize the reconstruction distortion, without loss of generality or loss of encoding-decoding power, we can set B = Inand optimize for βinstead.

This means that, our optimal decoder can in fact be considered as B = (ATA)−1AT, and since A in this case is orthonormal (due to PCA), we can simply have that B = AT.

So now that B is also determined, we are left only to optimizeβ. For this, we should first calculate distortion as follows.

Distortion: By noting that ˆf = ATx, the expected reconstruction distortion can probabilistically be characterized as:

D=EdE(F,Fˆ)

= 1

nE||F−ATX||22

= 1

nE||AFX||22 (3.33a)

= 1

nE||AFϕλF)⊙β||22 (3.33b)

= 1

nE||F˜−ϕλF)⊙β||22, where Eq. 3.33a follows from the orthonormality assumption of A.

This expression is useful since it links the distortion of the original domain with that of the projection domain.

3.3 The Sparse Ternary Codes 63 The total distortion D can be expressed as the sum of the distortions at each of the dimensions, i.e., D =Pnj=1Dj. Noting that ˜Fj, i.e., the elements of ˜F= [ ˜F1,· · · ,F˜n]T is This integration leads to the expression of distortion as:

Dj =σj2+ 2βj2Qλ

Weighting vector: Now we can find optimalβj that minimizes Dj. Fortunately, this can be expressed in a closed-form as:

βj= argmin

Fig. 3.3e sketchesβj in the ternary encoding of a Gaussian distribution. Note that in the special case whe λ= 0, the ternary encoding reduces to binary encoding and Eq. 3.35 reduces to the well-known binary quantization formula ∆ =±q2πσ, e.g., as in (10.1) of [2].

It should be mentioned that for the storage of codes, sinceβ is the same for all codes,x’s can be stored as fixed-point {+1,0,−1}values in memory. In fact,β is necessary to convert these fixed-point codes to floating-point values that can reconstruct thef’s.

Rate: Now that we have fully characterized the distortion of ternary encoding, we should also characterize its rate. In fact, this is similar to entropy calculation of section 3.3.1, where we had independent ternary variables with different sparsities. In this setup, however, we can only guarantee that these ternary variables are un-correlated. Therefore, by assuming independence, we can provide an upper-bound for rate as:

R⩽ 1

where we used the ternary entropy of Eq. 3.22.

Summary: Here we summarize the STC encoding of this section 3.3.2.2. Assuming that the data in the projection domain marginally follows the Gaussian distribution, we first apply the PCA transform to de-correlate the data. The ternarization is then performed

f

A Af φ(·) φ(Af)

β x=φ(Af)β

AT ATx

ˆ f

Fig. 3.6 A unit of STC encoding and decoding for reconstruction.

according to Eq. 3.29 for which values of β are calculated from Eq. 3.35. The decoding step for reconstruction is then performed using Eq. 3.30 for which we showed that B = AT is the optimal choice. These steps are sketched in Fig. 3.6.