# Discrete Semantics-Guided Asymmetric Hashing for Large-Scale Multimedia Retrieval
## 3 The Proposed DSAH Framework
### Optimization
\begin{split}\underset{\mathbf{V}}{\text{min}}& tr \big{(}\mathbf{B}^{\top}\mathbf{R}\mathbf{D}\mathbf{R}^{\top}\mathbf{V}\big{)}+ \frac{\xi}{2}||\mathbf{B}-\mathbf{V}+\frac{\mathbf{J}_{b}}{\xi}||_{F}^{2}.\\ & s.t.\ \{\mathbf{B},\mathbf{V}\}\in\{-1,1\}^{k\times n}\end{split}  \tag{15}\]  
Then, the value of \(\mathbf{V}\) can be solved with a closed-form solution,  
\[\mathbf{V}=sgn(-\mathbf{R}\mathbf{D}^{\top}\mathbf{R}^{\top}\mathbf{B}+\xi \mathbf{B}+\mathbf{J}_{b}). \tag{16}\]  
_Update \(\mathbf{J}_{b}\)_. The sub-problem related to \(\mathbf{J}_{b}\) can be updated as  
\[\mathbf{J}_{b}=\mathbf{J}_{b}+\xi(\mathbf{B}-\mathbf{V}),\ \xi=\rho\xi, \tag{17}\]  
where \(\rho\) is a parameter to control the convergence speed. _Fix \(\mathbf{B},\mathbf{P}_{1},\mathbf{P}_{2}\), update \(\mathbf{R}\)_. The sub-problem of Equation (8) related to \(\mathbf{R}\) can be formulated as  
\[\underset{\mathbf{R}}{\text{min}}\ tr(\mathbf{E}^{\top}\mathbf{D}\mathbf{E})+ \gamma\ Re(\mathbf{R}). \tag{18}\]  
In the next step, we need to solve the following problem:  
\[\underset{\mathbf{R}}{\text{min}}\ tr(\mathbf{B}^{\top}\mathbf{R}\mathbf{D} \mathbf{R}^{\top}\mathbf{B}-2\mathbf{B}\mathbf{L}^{\top}\mathbf{D}\mathbf{R} ^{\top})+\gamma tr(\mathbf{R}\mathbf{R}^{\top}). \tag{19}\]  
Setting the derivative Equation (20) w.r.t \(\mathbf{R}\) to 0, we obtain  
\[\mathbf{B}\mathbf{B}^{\top}\mathbf{R}\mathbf{D}+\gamma\mathbf{R}=\mathbf{B} \mathbf{L}^{\top}\mathbf{D}. \tag{20}\]  
We transform Equation (20) into  
\[\mathbf{B}\mathbf{B}^{\top}\mathbf{R}+\gamma\mathbf{R}\mathbf{D}^{-1}= \mathbf{B}\mathbf{L}^{\top}. \tag{21}\]  
Then, it can be seen that Equation (21) is a Sylvester equation. Therefore, the value of \(\mathbf{R}\) can be easily solved. Due to the space limitation, the detail about the solution is not given here. _Fix \(\mathbf{B},\mathbf{R},\mathbf{P}_{2}\), update \(\mathbf{P}_{1}\)_. The sub-problem of Equation (8) related to \(\mathbf{P}_{1}\) can be formulated as  
\[ \begin{split}\min_{\mathbf{P}_{1}}&||(\mathbf{P}_{1} \phi(\mathbf{X}^{(1)}))^{\top}\mathbf{B}-k\mathbf{S}||_{F}^{2}+\alpha|| \mathbf{B}-0.5\Big{(}\mathbf{P}_{1}\phi(\mathbf{X}^{(1)})+\mathbf{P}_{2}\phi( \mathbf{X}^{(2)})\Big{)}||_{F}^{2}\\ &+\gamma\;Re(\mathbf{P}_{1}^{*}),\\ & s.t.\;\mathbf{B}\in\{-1,1\}^{k\times n}\end{split}  \tag{22}\]  
Setting the derivative Equation (22) w.r.t \(\mathbf{P}_{1}\) to 0, we obtain  
\[ \begin{split}& 2\mathbf{P}_{1}\phi(\mathbf{X}^{(1)})\phi( \mathbf{X}^{(1)})^{\top}-2k\mathbf{B}\mathbf{S}^{\top}\phi(\mathbf{X}^{(1)})^ {\top}-4\alpha\mathbf{B}\phi(\mathbf{X}^{(1)})^{\top}+2\alpha\mathbf{P}_{1} \phi(\mathbf{X}^{(1)})\phi(\mathbf{X}^{(1)})^{\top}\\ &+2\alpha\mathbf{P}_{2}\phi(\mathbf{X}^{(2)})\phi(\mathbf{X}^{(1 )})^{\top}+2\gamma\mathbf{P}_{1}(\mathbf{X}^{(1)})\phi(\mathbf{X}^{(1)})^{ \top}=0\end{split}  \tag{23}\]  
Then, the value of \(\mathbf{P}_{1}\) can be solved with a closed-form solution:  
\[ \begin{split}\mathbf{P}_{1}=&(k\mathbf{B}\mathbf{S }^{\top}\phi(\mathbf{X}^{(1)})^{\top}+2\alpha\mathbf{B}\phi(\mathbf{X}^{(1)})^ {\top}-\alpha\mathbf{P}_{2}\phi(\mathbf{X}^{(2)})\phi(\mathbf{X}^{(1)})^{\top }).\\ &((1+\alpha+\gamma)\phi(\mathbf{X}^{(1)})\phi(\mathbf{X}^{(1)})^{ \top})^{-1}\end{split}  \tag{24}\]  
where \(\mathbf{S}\) is also transformed using Equation (13); then, we have  
\[\mathbf{B}\mathbf{S}^{\top}\phi(\mathbf{X}^{(1)})^{\top}=2(\mathbf{B}\mathbf{ L}^{\top})(\phi(\mathbf{X}^{(1)})\mathbf{L}^{\top})^{\top}-(\mathbf{B} \mathbf{1}_{n})(\phi(\mathbf{X}^{(1)})\mathbf{1}_{n})^{\top}, \tag{25}\]  
which consumes \(\mathcal{O}((q+k)cn)\). _Fix \(\mathbf{B},\mathbf{R},\mathbf{P}_{1}\), update \(\mathbf{P}_{2}\)_. The sub-problem of Equation (8) related to \(\mathbf{P}_{2}\) can be formulated as  
\[