## 3 Interactive Guiding Sparse Autoencoder
 \tag{12}\]  
In the third process, there is a reconstruction loss \(J_{AE}\), and the loss can be calculated by the output vector of the reconstruction layer \(X^{\prime}\). The output of the reconstruction layer is calculated as follows:  
\[ \begin{array}{ll}X^{\prime}&=\phi(W_{2}H+b_{2})+\phi(W_{2}{}^{\prime}G+b_{2 }{}^{\prime})\\ &=\phi(W_{2}\phi(W_{1}X+b_{1})+b_{2})+\phi(W_{2}{}^{\prime}\phi(W_{1}{}^{ \prime}X+b_{1}{}^{\prime})+b_{2}{}^{\prime})\end{array}  \tag{13}\]  
where \(\phi\) is the activation function, and \(W_{2}\) and \(b_{2}\) denote the weight and bias between the hidden and output layers, respectively. \(W_{2}{}^{\prime}\) and \(b_{2}{}^{\prime}\) denote the weight and bias between the guiding and output layers, respectively. The \(J_{AE}\) is a typical loss used in the existing autoencoder and is the main loss of IGSAE. In general, the mean squared deviation is used for linear cases, and cross-entropy is used for non-linear cases. In this section, we compute using mean squared deviation. \(J_{AE}\) is computed as follows:  
\[ \begin{array}{ll}J_{AE}&=\frac{1}{2n}\parallel X-X^{\prime}\parallel^{2}\\ &=\frac{1}{2n}\parallel X-\phi(W_{2}\phi(W_{1}X+b_{1})+b_{2})+\phi(W_{2}{}^{ \prime}\phi(W_{1}{}^{\prime}X+b_{1}{}^{\prime})+b_{2}{}^{\prime})\parallel^{2 }\end{array}  \tag{14}\]  
In the fourth process, IGSAE has a second guiding part. Its operation step is almost the same to obtain the first guiding layer, and the two guide layers operate complementarily. The second guiding regularization term (\(J_{sg}\)) is calculated as follows:  
\[ \begin{array}{ll}G_{2}&=\phi(W_{3}X^{\prime}+b_{3})\\ &=\phi(W_{3}(\phi(W_{2}\phi(W_{1}X+b_{1})+b_{2})+\phi(W_{2}{}^{\prime}\phi(W_{ 1}{}^{\prime}X+b_{1}{}^{\prime})+b_{2}{}^{\prime}))+b_{3})\end{array}  \tag{15}\]  
\[ \begin{array}{ll}J_{sg}&=\frac{1}{2n}\parallel X_{g}-G_{2}\parallel^{2}\\ &=\frac{1}{2n}\parallel X_{g}-\phi(W_{3}(\phi(W_{2}\phi(W_{1}X+b_{1})+b_{2})+ \phi(W_{2}{}^{\prime}\phi(W_{1}{}^{\prime}X+b_{1}{}^{\prime})+b_{2}{}^{\prime }))+b_{3})\parallel^{2}\end{array}  \tag{16}\]  
where \(W_{3}\) and \(b_{3}\) are the weight and bias between the output layer and the second guiding layer, respectively. The guiding term \(\left(J_{guide}\right)\) is computed by two guiding terms Equations (10) and (16), and is formulated as follows:  
\[J_{guide}=J_{fg}+J_{sg} \tag{17}\]  
\(J_{guide}\) is the loss of the two guiding layers that learn the distribution of the real label. If the distribution of the label can be influenced in the learning process of the autoencoder, then overfitting, which learns only to reduce the reconstruction loss [36], can be restricted. Therefore, the objective function of IGSAE using the above Equations (12), (14) and (17), and the Wasserstein regularization term (\(J_{was}\)) is defined as:\[ \begin{array}{ll}\min_{w\in W}J_{IGSAE}&=\min_{w\in W}J_{AE}+\epsilon J_{sparse}+ \lambda J_{guide}+\mu J_{was}\\ &=\min_{w\in W}\frac{1}{2n}\parallel X-X^{\prime}\parallel^{2}+\varepsilon \sum\limits_{j=1}^{s}KL(\rho||\hat{p}_{j})+\lambda\frac{1}{2n}\parallel X_{g }-G_{2}\parallel^{2}\\ &+\frac{1}{2n}\parallel X_{g}-G_{1}\parallel^{2}+\mu\inf_{r\in\prod(P_{\theta _{1}},\,P_{\theta_{2}})}\mathrm{E}_{(X,\,H)\sim\gamma}[d(G_{1},\,\,G_{2})] \end{array}  \tag{18}\]  
where \(\epsilon\), \(\lambda\), and \(\mu\) are coefficients to balance the \(J_{IGSAE}\). \(W\) is the weight of IGSAE. \(\theta_{1}\) is the parameter of the first guiding layer and \(\theta_{2}\) is the parameter of the second guiding layer. \(P_{\theta_{1}}\) is the pretrained prior distribution, which we assume is real data distribution. \(P_{\theta_{2}}\) is the latent variable distribution. \(\prod(P_{\theta_{1}},\,P_{\theta_{2}})\) denotes the set of all joint distributions \(d(G_{1},\,\,G_{2})\) whose marginals are \(P_{\theta_{1}}\) and \(P_{\theta_{2}}\), respectively. When learning IGSAE, the influence of the first guiding layer becomes too strong, which can increase the reconstruction loss.