## 6 RSS Difference-Aware Graph-Based Semi-Supervised Learning RSS Smoothing Method
### Finding the Optimal Solution  
The cost function in (18) can be written as:  
\[ \begin{split} C=&\sum_{i=1}^{\ell}\left\|\hat{r}_{i }-r_{i}\right\|^{2}+\frac{\gamma}{2}\sum_{i=1}^{\ell+u}\sum_{j=1}^{\ell+u}w_{ ij}\|\hat{r}_{i}-\hat{r}_{j}\|^{2}\\ &+\frac{\gamma}{2}\sum_{i=1}^{\ell+u}\sum_{j=1}^{\ell+u}w_{ij} \hat{R}_{d}^{2}(S_{i},S_{j})+\gamma\sum_{i=1}^{\ell+u}\sum_{j=1}^{\ell+u}w_{ ij}\hat{R}_{d}(S_{i},S_{j})\|\hat{r}_{i}-\hat{r}_{j}\|,\end{split}  \tag{21}\]  
In order to find the optimal solution, we need to find the derivative of the cost function with respect to \(\hat{\mathbf{R}}\). Since the cost function of (21) is not convex, we use the gradient descent method to solve the optimization problem. Next, we derive the derivative for each part of the cost function in (21). The first part of (21) can be written as:  
\[ \begin{split} C_{1}&=\sum_{i=1}^{\ell}\|\hat{r}_{i }-r_{i}\|^{2}\\ &=\text{trace}\big{(}\big{(}\hat{\mathbf{R}}-\mathbf{R}\big{)} \mathbf{J}^{\text{T}}\mathbf{J}\big{(}\hat{\mathbf{R}}^{\text{T}}-\mathbf{R}^ {\text{T}}\big{)}\big{)},\end{split}  \tag{22}\]  
where \(\mathbf{R}=[r_{1}\ r_{2}\ \dots\ r_{\ell+u}]\) is the RSS matrix and if the labels are not given, we use \(\mathbf{0}_{M\times 1}\) instead. \(\mathbf{J}=\text{diag}(\delta_{1},\delta_{2},\dots,\delta_{\ell+u})\) is a Hermitian indication matrix where \(\delta_{i}=1\) means that the corresponding \(i\)-th node in the graph is labelled and \(\delta_{i}=0\) otherwise. Using (22), \(\frac{\partial C_{1}}{\partial\mathbf{R}}\) can be written as:  
\[ \begin{split}\frac{\partial C_{1}}{\partial\hat{\mathbf{R}}}& =\big{(}\hat{\mathbf{R}}-\mathbf{R}\big{)}\big{(}\mathbf{J}+ \mathbf{J}^{\text{T}}\big{)}\\ &=2\mathbf{J}\big{(}\hat{\mathbf{R}}-\mathbf{R}\big{)},\end{split}  \tag{23}\]  
The second part of (21) can rearranged as:\[C_{2} =\frac{\gamma}{2}\sum\limits_{i=1}^{\ell+u}\sum\limits_{j=1}^{\ell+u}w _{ij}\|\hat{r}_{i}-\hat{r}_{j}\|^{2} \tag{24}\] \[=\gamma\sum\limits_{i=1}^{\ell+u}\hat{r}_{i}^{T}\hat{r}_{i}\sum \limits_{j=1}^{\ell+u}w_{ij}-\gamma\sum\limits_{i=1}^{\ell+u}\sum\limits_{j=1} ^{\ell+u}w_{ij}\hat{r}_{i}^{T}\hat{r}_{j}\] \[=\gamma\text{trace}\big{(}\hat{\mathbf{R}}\mathbf{D}\mathbf{R}^{T }\big{)}-\gamma\text{trace}\big{(}\hat{\mathbf{R}}\mathbf{W}\mathbf{R}^{T} \big{)}\] \[=\gamma\text{trace}\big{(}\hat{\mathbf{R}}\mathbf{L}\mathbf{R}^{T }\big{)},\]  
where \(\mathbf{L}=\mathbf{D}-\mathbf{W}\) is the graph Laplacian and \(\mathbf{D}=\text{diag}(\mu_{1},\mu_{2},\ldots,\mu_{\ell+u})\) where \(\mu_{i}=\sum\limits_{j=1}^{\ell+u}w_{ij}\) for all \(i\in\{1,2,\ldots,\ell+u\}\). Differentiating \(C_{2}\) yields,  
\[\frac{\partial C_{2}}{\partial\hat{\mathbf{R}}}=2\gamma\hat{\mathbf{R}} \mathbf{L}, \tag{25}\]  
The derivative of the third part of the cost with respect to \(\hat{\mathbf{R}}\) is equal to 0. The last part of (21) is:  
\[C_{4} =\gamma\sum\limits_{i=1}^{\ell+u}\sum\limits_{j=1}^{\ell+u}w_{ij }\hat{R}_{d}(S_{i},S_{j})\|\hat{r}_{i}-\hat{r}_{j}\| \tag{26}\] \[=\gamma\sum\limits_{i=1}^{\ell+u}\sum\limits_{j=1}^{\ell+u}\kappa _{ij}\|\hat{r}_{i}-\hat{r}_{j}\|,\]  
where \(\kappa_{ij}=w_{ij}\hat{R}_{d}(S_{i},S_{j})\). In order to find \(\frac{\partial C_{4}}{\partial\mathbf{R}}\), first we find \(\frac{\partial C_{4}}{\partial\mathbf{r}_{n}}\) for \(1\leq n\leq\ell+u\). Using [34],  
\[\frac{\partial C_{4}}{\partial\hat{r}_{n}} =\frac{\partial}{\partial\hat{r}_{n}}\bigg{(}\gamma\sum\limits_{ i=1}^{\ell+u}\sum\limits_{j=1}^{\ell+u}\kappa_{ij}\|\hat{r}_{i}-\hat{r}_{j}\| \bigg{)} \tag{27}\] \[=\frac{\partial}{\partial\hat{r}_{n}}\bigg{(}\gamma\sum\limits_{ j=1,j\
eq n}^{\ell+u}\kappa_{nj}\|\hat{r}_{n}-\hat{r}_{j}\|\bigg{)}+\frac{\partial}{ \partial\hat{r}_{n}}\bigg{(}\gamma\sum\limits_{i=1,j\
eq n}^{\ell+u}\kappa_{in} \|\hat{r}_{i}-\hat{r}_{n}\|\bigg{)}\]  
Since \(\kappa_{ij}=w_{ij}\hat{R}_{d}(S_{i},S_{j})\), \(\kappa_{ni}=\kappa_{in}\).