As we discussed before, $g(x,c)$ should be the “best encoder" for the decoder to recover $x$. Thus we should optimize $g(x,c)$ by maximizing the following objective function: $$\begin{gathered}
\log{p(x|z_{label},c)}=\log{p(x|g(x,c),c)}\label{eq:labeling}\end{gathered}$$ with the decoder fixed. An alternative training schedule of the VAE/CVAE network and the labeling network is applied.

Fig. \[fig:slcvae\] shows the overview of the whole proposed method. The CVAE part of our structure is a conventional CVAE with reparameterization trick[@kingma2013auto] by introducing a posterior and a prior network as described in [@zhao2017learning] in detail. The structure of the labeling network is similar to the encoder of the CVAE which consists of a target encoder and a context encoder which embed target and source sentences to representative vectors. The only difference is that the labeling encodes its inputs into a fixed $z_{label}$ rather than a distribution.

Training Process
----------------

To optimize Equation. \[eq:slcvae\] and Equation. \[eq:labeling\], we parameterize all the three modules: the encoder $q_{\phi}(z|x, c)$ and decoder $p_{\theta}(x|z, c)$ of the CVAE, and the labeling network $g_{\gamma}(x, c)$. An alternative training schedule is used with two phases: the CVAE phase and the Labeling phase.

In the CVAE phase, we minimize the loss function of the SLCVAE: $$\begin{gathered}
\min_{\phi,\theta,\beta}\mathcal{L}_\mathsf{SLCVAE}=\min_{\phi,\theta,\beta}[-\mathbb{E}_{q_{\phi}(z|x,c)}[p_{\theta}(x|z,c)]\nonumber \\
+KL(q_{\phi}(z|x,c)||p_{\beta}(z|c)) 