In this section, we will explain the implementation details of ARM for Bernoulli contextual dropout. To compute the gradients with respect to the parameters of the variational distribution,
a commonly used gradient estimator is the REINFORCE estimator [1]} as
\(\begin{split}&\nabla _{\varphi }\mathcal {L}(x,y) = \mathbb {E}_{z\sim q_{}(\cdot \,|\,x)}[r(x,z,y)\nabla _{\varphi }\log q_{}(z\,|\,x)],~~\textstyle r(x,z,y): =\log \frac{ p_{\theta }(y\,|\,x,z) p_{{\eta }}(z)}{q_{{}}(z\,|\,x)}.\end{split}\) 
