# Improving Steerability Detection via an Aggregate Class Distribution Neural Network
## 3 Detecting the Steerability by AGGNN
### Training and Testing  
In the AGGNN model, the structure parameters of the network are shown in the Table 1. Features of the batch samples are normalized by layer normalization of dimension \([n,d_{v}]\). We set the weight parameters of the loss function \(\lambda\) equal to 0.5, \(\mu\) equal to 0.5 and \(\gamma\) between 0.01 and 0.001. The optimization algorithm of the network is the Adam gradient descent algorithm. We set the batchsize to 200 and the learning rate to 0.001. To verify that our model has a better generalization ability and robustness to inaccurate data in quantum-steering detection problems, we trained the models on the F1-F4 feature datasets, comparing their classification accuracy in the cross validation test set, random test set and Werner state validation set, Figure 3a-d. Furthermore, we compared the training difficulty of the AGGNN and BPNN models, as in Figure 4. The classification accuracy of a model in a dataset is the percentage of correctly predicted number of samples corresponding to the size of the dataset. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Feature**} & \multicolumn{3}{c}{**The Number of Hidden Layers**} \\ \cline{2-5}  & **Feature Extraction Layer** & **Classification Layer** & **The Number of Neurons in Each Layer** & \(d_{v}\) \\ \hline F1 & 2 & \(1\) & 1000 & 1000 \\ \hline F2 & 2 & \(1\) & 500 & 500 \\ \hline F3 & 2 & \(1\) & 500 & 500 \\ \hline F4 & 2 & \(1\) & 200 & 200 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The structural parameters of AGGNN. Figure 3: (**a–d**) Classification accuracy of the classification models with F1–F4 features. The first (diagonal-filled blue), second (diagonal-filled green) and third (diagonal-filled red) columns illustrate the accuracy of the cross validation of the classification models trained by the SVM, BPNN and AGGNN, respectively. The forth (grid-filled blue), fifth (grid-filled green) and sixth (grid-filled red) columns illustrate the classification accuracy on random states of the classification models trained by the SVM, BPNN and AGGNN, respectively. The seventh (solid blue), eighth (solid green) and ninth (solid red) columns illustrate the classification accuracy on the Werner state of the classification models trained by the SVM, BPNN and AGGNN, respectively. The label m is the number of measurements. In order to make our model have better stability and generalization, inspired by [45], we used four-fold cross validation to train the model. In this method, the data set is divided into four mutually exclusive subsets of similar size, and the data distribution consistency of each subset is maintained as much as possible. Then, each time, the union of three subsets is used as the training set, and the remaining subset is used as the test set. In this way, we can obtain four training test sets to conduct four training and testing experiments to return the mean of the four test results. First, to verify the model's generalization ability to the training data, we obtained the test accuracy rate of four-fold cross validation. In Figure 3a-d, the four-fold cross-validation accuracies of the classification models trained by the SVM [45], BPNN [48] and AGGNN are depicted by the first (diagonal-filled blue), second (diagonal-filled green) and third (diagonal-filled red) columns, respectively. Second, in order to verify the learning ability of the model to the dataset, we randomly took 2000 samples from the dataset as a random test set. In Figure 3a-d, the random test set accuracies of the classification models trained by the SVM [45], BPNN [48] and AGGNN are depicted by the fourth (grid-filled blue), fifth (grid-filled green) and sixth (grid-filled red) columns, respectively. Third, because the data generated by the SDP is inaccurate, the high accuracy of the model on cross-validation test sets and random test sets may lead to overfitting problems. This problem can be avoided by verifying the classification accuracy of the model on the Werner state validation sets. These states have correct labels.