# Network Traffic Type-Based Quality of Experience (QoE) Assessment for Universal Services
## 3 Proposed Method
### Determining the Model Parameters
Calculating the gradient of \(loss_{i}\) to model hyperparameters, we have  
\[\frac{\partial loss_{i}}{\partial\alpha}=\frac{\partial loss_{i}}{\partial O _{i}}\cdot\frac{\partial O_{i}}{\partial S_{i}}\cdot\frac{\partial S_{i}}{ \partial\alpha}=-\sum_{k=1}^{5}\bigg{(}\big{(}\frac{t_{i,k}}{o_{i,k}}-\frac{1- t_{i,k}}{1-o_{i,k}}\big{)}\frac{\partial o_{i,k}}{\partial S_{i}}\cdot\exp(- \beta\cdot QoS_{i})\bigg{)} \tag{10}\]  
Let \(g_{i,k}=\big{(}\frac{t_{i,k}}{o_{i,k}}-\frac{1-t_{i,k}}{1-o_{i,k}}\big{)}\frac {\partial o_{i,k}}{\partial S_{i}}\), similarly, we can derive \[\frac{\partial loss_{i}}{\partial\beta} =\frac{\partial loss_{i}}{\partial O_{i}}\cdot\frac{\partial O_{i}} {\partial S_{i}}\cdot\frac{\partial S_{i}}{\partial\beta}=\sum_{k=1}^{5}\left( g_{i,k}\cdot\alpha QoS_{i}\exp(-\beta\cdot QoS_{i})\right) \tag{11}\] \[\frac{\partial loss_{i}}{\partial\gamma} =\frac{\partial loss_{i}}{\partial O_{i}}\cdot\frac{\partial O_{i }}{\partial S_{i}}\cdot\frac{\partial S_{i}}{\partial\gamma}-\sum_{k=1}^{5} \left(g_{i,k}\right)\] \[\frac{\partial loss_{i}}{\partial a} =\frac{\partial loss_{i}}{\partial O_{i}}\cdot\frac{\partial O_{i }}{\partial S_{i}}\cdot\frac{\partial S_{i}}{\partial QoS_{i}}\cdot\frac{ \partial QoS_{i}}{\partial a}=\sum_{k=1}^{5}\left(g_{i,k}\cdot\alpha\beta\exp(- \beta\cdot QoS_{i}+b\cdot DL_{i})\right)\] \[\frac{\partial loss_{i}}{\partial b} =\frac{\partial loss_{i}}{\partial O_{i}}\cdot\frac{\partial O_{i }}{\partial S_{i}}\cdot\frac{\partial S_{i}}{\partial QoS_{i}}\cdot\frac{ \partial QoS_{i}}{\partial b}=\sum_{k=1}^{5}\left(g_{i,k}\cdot\alpha\beta a \cdot DL_{i}\exp(-\beta\cdot QoS_{i}+b\cdot DL_{i})\right)\] \[\frac{\partial loss_{i}}{\partial c} =\frac{\partial loss_{i}}{\partial O_{i}}\cdot\frac{\partial O_{i }}{\partial S_{i}}\cdot\frac{\partial S_{i}}{\partial QoS_{i}}\cdot\frac{ \partial QoS_{i}}{\partial c}=\sum_{k=1}^{5}\left(g_{i,k}\cdot\alpha\beta\exp(- \beta\cdot QoS_{i})\cdot\frac{1}{LR_{i}+d}\right)\] \[\frac{\partial loss_{i}}{\partial d} =\frac{\partial loss_{i}}{\partial O_{i}}\cdot\frac{\partial O_{i }}{\partial S_{i}}\cdot\frac{\partial S_{i}}{\partial QoS_{i}}\cdot\frac{ \partial QoS_{i}}{\partial d}=-\sum_{k=1}^{5}\left(g_{i,k}\cdot\alpha\beta\exp( -\beta\cdot QoS_{i})\cdot\frac{c}{(LR_{i}+d)^{2}}\right)\] \[\frac{\partial loss_{i}}{\partial p} =\frac{\partial loss_{i}}{\partial O_{i}}\cdot\frac{\partial O_{i }}{\partial S_{i}}\cdot\frac{\partial S_{i}}{\partial QoS_{i}}\cdot\frac{ \partial QoS_{i}}{\partial p}=\sum_{k=1}^{5}\left(g_{i,k}\cdot\alpha\beta\exp( -\beta\cdot QoS_{i})\cdot\log(TH_{i})\right)\] \[loss_{i} = -\sum_{k=1}^{5}\big{(}t_{i,k}\log o_{i,k}+(1-t_{i,k})\log{(1-o_{ i,k})}\big{)}+l_{2}\cdot\sum_{k}\Theta_{k}^{2} \tag{9}\]0  
With Equations (10) and (11), we can calculate the gradient of each hyperparameter reflecting to the QoE score fitting error, the hyperparameter determination algorithm is abstracted by the pseudocode presented in Algorithm 1, where parameters \(bs\), \(eps\), and \(\lambda\) are set to 16, 100, and 0.01 in our implementation, respectively. ```
Input: Dataset \(\Omega=\left\{DL_{i},LR_{i},TH_{i}:QoE_{i}\right\}\), \(i=1,\cdots,N\). Output: Model determined hyperparameters: \(\Theta=\left\{a,\beta,\gamma,a,b,c,d,p,q\right\}\). \(\Theta=\text{Train}(\Omega)\): Set batch size \(bs\), epoch size \(eps\), and learning rate \(\lambda\); for\(i=1\) to \(eps\)do for\(j=1\) to \(int(\frac{N}{bs})\)do  Initialize \(loss=0\); for each sample \(\left\{DL_{k},LR_{k},TH_{k}:QoE_{k}\right\}\) in \(\Omega[bs*(j-1)+1:bs*j]\)do  According to (9), \(loss+=loss_{k}\);  end for  Calculate average loss by \(\overline{loss}=\frac{loss}{bs}\); for each hyperparameter \(\theta_{k}\) in \(\Theta\)do  According to (10) and (11), update \(\theta_{k}\) by gradient: \(\theta_{k}\leftarrow\theta_{k}-\lambda\cdot\frac{\overline{doss}}{\theta_{k}^{2}}\)  end for  end for  end for return\(\Theta\)
```  
**Algorithm 1**Model Parameter Determination Algorithm.