Thirdly, we need to implement \(p_{\theta }(y | R, \widetilde{m}, z_c, \widetilde{c})\)  where \(\widetilde{m} \sim p_{\varphi }(m |R)\) , \(z_c \sim q_{\phi }(z_c | \widetilde{c})\)  and \(\widetilde{c} \sim p(c)\) . After randomly selecting \(\widetilde{c}\)  from the dataset, we obtain a vector \(z_c\)  by sampling from \(q_{\phi }(z_c | \widetilde{c})\) . Since \(\widetilde{m}\)  has been already encoded to \(z_m\) , we simply use a top-down attention LSTM network [1]} to decode each token:
\(\mathcal {L}^g=-\sum _{t=1}^{T} \log \left(p_{\theta }\left(y_{t} \mid y_{<t}, R^{(n)}, z_m, z_c\right)\right)\) 
