# Guided Semi-Supervised Non-Negative Matrix Factorization
## Appendix A GSSNMF Algorithm: Multiplicative Updates Proof  
We begin with a corpus matrix \(\mathbf{X}\in\mathbb{R}_{\geq 0}^{d\times n}\), a seed matrix \(\mathbf{Y}\in\mathbb{R}_{\geq 0}^{d\times s}\), a label matrix \(\mathbf{Z}\in\mathbb{R}_{\geq 0}^{p\times n}\), and a masking matrix \(\mathbf{L}\in\mathbb{R}_{\geq 0}^{p\times n}\). From these, we hope to find dictionary matrix \(\mathbf{W}\in\mathbb{R}_{\geq 0}^{d\times k}\), coding matrix \(\mathbf{H}\in\mathbb{R}_{\geq 0}^{k\times n}\), and supervision matrices \(\mathbf{B}\in\mathbb{R}_{\geq 0}^{k\times s}\) and \(\mathbf{C}\in\mathbb{R}_{\geq 0}^{p\times k}\) that minimize the loss function:  
\[ \begin{array}{ll}&F(\mathbf{W},\mathbf{H},\mathbf{B},\mathbf{C})\\ =&\frac{1}{2}\|\mathbf{X}-\mathbf{W}\mathbf{H}\|^{2}+\frac{\lambda}{2}\|\mathbf{Y}-\mathbf{W}\mathbf{ B}\|^{2}+\frac{\mu}{2}\|\mathbf{L}\odot(\mathbf{Z}-\mathbf{C}\mathbf{H})\|^{2}\\ =&\frac{1}{2}\operatorname{tr}[\mathbf{XX}^{\top}-2\mathbf{X}\mathbf{H}^{\top}\mathbf{W}^{ \top}+\mathbf{W}\mathbf{H}\mathbf{H}^{\top}\mathbf{W}^{\top}]+\frac{\lambda}{2}\operatorname{ tr}[\mathbf{YY}^{\top}-2\mathbf{Y}\mathbf{B}^{\top}\mathbf{W}^{\top}+\mathbf{W}\mathbf{B}\mathbf{B}^{\top}\mathbf{W}^{ \top}]\\ &+\frac{\mu}{2}\operatorname{tr}[(\mathbf{L}\odot\mathbf{Z})(\mathbf{L}^{\top}\odot\mathbf{Z}^ {\top})-2(\mathbf{L}\odot\mathbf{Z})(\mathbf{L}^{\top}\odot\mathbf{H}^{\top}\mathbf{C}^{\top})+( \mathbf{L}\odot\mathbf{C}\mathbf{H})(\mathbf{L}^{\top}\odot\mathbf{H}^{\top}\mathbf{C}^{\top})].\end{array} \]  
By introducing the Lagrange multipliers \(\alpha\in\mathbb{R}^{d\times k}\), \(\beta\in\mathbb{R}^{k\times n}\), \(\gamma\in\mathbb{R}^{k\times s}\), \(\delta\in\mathbb{R}^{p\times k}\), we are going to consider the following optimization problem:  
\[\min_{\mathbf{W},\mathbf{H},\mathbf{B},\mathbf{C}}\mathcal{L}(\mathbf{W},\mathbf{H},\mathbf{B},\mathbf{C}, \alpha,\beta,\gamma,\delta)\]  
with  
\[\mathcal{L}(\mathbf{W},\mathbf{H},\mathbf{B},\mathbf{C},\alpha,\beta,\gamma,\delta)=F(\mathbf{W}, \mathbf{H},\mathbf{B},\mathbf{C})+\operatorname{tr}(\alpha\mathbf{W}^{\top})+\operatorname{ tr}\bigl{(}\beta\mathbf{H}^{\top}\bigr{)}+\operatorname{tr}(\gamma\mathbf{B}^{\top})+ \operatorname{tr}(\delta\mathbf{C}^{\top}).\]  
Taking the derivatives with respect to the matrices \(\mathbf{W}\), \(\mathbf{B}\), \(\mathbf{H}\) and \(\mathbf{C}\), we derive the following equations:\[ \begin{array}{ll}\frac{\partial\mathcal{L}}{\partial\mathbf{W}}&=-\mathbf{X}\mathbf{H}^{ \top}+\mathbf{W}\mathbf{H}\mathbf{H}^{\top}-\lambda\mathbf{Y}\mathbf{B}^{\top}+\lambda\mathbf{W}\mathbf{B} \mathbf{B}^{\top}+\alpha=0,\\ \frac{\partial\mathcal{L}}{\partial\mathbf{B}}&=-\lambda\mathbf{W}^{\top}\mathbf{Y}+ \lambda\mathbf{W}^{\top}\mathbf{W}\mathbf{B}+\gamma=0,\\ \\ \frac{\partial\mathcal{L}}{\partial\mathbf{H}}&=-\mathbf{W}^{\top}\mathbf{X}+\mathbf{W}^{\top} \mathbf{W}\mathbf{H}-\mu\mathbf{C}^{\top}(\mathbf{L}\odot\mathbf{L}\odot\mathbf{Z})+\mu\mathbf{C}^{\top}( \mathbf{L}\odot\mathbf{L}\odot\mathbf{C}\mathbf{H})+\beta=0,\\ \\ \frac{\partial\mathcal{L}}{\partial\mathbf{C}}&=-\mu(\mathbf{L}\odot\mathbf{L}\odot\mathbf{Z} )\mathbf{H}^{\top}+\mu(\mathbf{L}\odot\mathbf{L}\odot\mathbf{C}\mathbf{H})\mathbf{H}^{\top}+\delta=0. \end{array} \]  
with the Karush-Kuhn-Tucker conditions, we have complementary slackness condition  
\[\alpha\odot\mathbf{W}=\beta\odot\mathbf{H}=\gamma\odot\mathbf{B}=\delta\odot\mathbf{C}=0.\]  
As such, we arrive at the following stationary equations:  
\[