# Improving Steerability Detection via an Aggregate Class Distribution Neural Network
## 2 Preliminaries
### AGGNN Model  
AGCNN aggregates the class distribution of samples by similarity measure during the network training process to enlarge the difference between different class sample features extracted by the model to improve the model's robustness and prediction ability. The network model is divided into three parts: feature extraction layer, classification layer, and aggregate class distribution layer. As shown in Figure 1.  
**Feature extraction layer. ** During the training process, we randomly select a batch of examples as \(B=\left\{(x_{i},y_{i}):x_{i}\in\mathbb{R}^{1\times d},y_{i}\in Y,i\in(1,\ldots, n)\right\}\), where \(x_{i}\) is a sample, \(y_{i}\) is a label of \(Y=\{0,1\}\), \(d\) is the data dimension of the sample, and \(n\) is an even number representing the batchsize. Half of the batches contains unsteerable samples where \(y_{i\in\{1,\ldots,n/2\}}=1\), while the other half contains steerable samples where \(y_{i\in\{(n/2)+1,\ldots,n\}}=0\). We obtain the features for every sample in each batch of training data through the feature extraction layer, and this process can be expressed as follows  
\[\mathbf{V}=\text{FEMLP}(\mathbf{X}), \tag{8}\]  
where \(\mathbf{X}=[x_{1},x_{2},\dots,x_{n}]^{\text{T}}\in\mathbb{R}^{n\times d}\) is the matrix composed of a batch of samples (the superscript T denotes transpose of matrices), FEMLP is a multilayer perceptron for feature extraction [51], and \(\mathbf{V}\in\mathbb{R}^{n\times d_{v}}\) is the feature matrix of the samples (\(d_{v}\) is the dimension of the feature vector of a sample). **Classification layer. ** After obtaining the features of the samples, we make the features pass through the classification layer to obtain the predicted class distribution, and this process can be written as  
\[\mathbf{P}=\text{CMLP}(\mathbf{V}), \tag{9}\]  
Figure 1: The structure diagram of the AGGNN model’s training process. \(a_{ij}\) is the element of the \(i\)th row and \(j\)th column of the similarity matrix \(\mathbf{A}\), and \(b_{ij}\) is the element of the \(i\)th row and \(j\)th column of the positive and negative correlation similarity matrix \(\mathbf{B}\). Firstly, we obtain feature \(\mathbf{V}\) and class distribution \(\mathbf{P}\) of the quantum states through the feature extraction layer and classification layer, respectively. Then we input the feature and class distribution into aggregate the class distribution layer to obtain the aggregate class distribution \(\mathbf{\bar{P}}\) and cosine similarity between the prototypes. Finally, we calculate the loss for weighted combinations of class distribution, aggregate class distribution and cosine similarity between the prototypes. By reducing the loss of the aggregate class distribution of samples, the model can enlarge the difference between different class sample features extracted by the model to improve the model’s robustness and prediction ability. where \(\textbf{P}\in\mathbb{R}^{n\times 2}\) is the predicted class distribution of the samples, and CMLP is a multilayer perceptron for classification [51]. **Aggregate distribution layer. ** In order to accurately calculate the similarity of the samples feature **V**, we first normalize **V**. The normalization process is as follows. \[ \begin{split}\mu&=\frac{1}{n\times d_{v}}\sum_{i=1}^{ n}\sum_{j=1}^{dv}v_{ij},\\ \sigma&=\sqrt{\frac{1}{n\times d_{v}}\sum_{i=1}^{n} \sum_{j=1}^{dv}\big{(}v_{ij}-\mu\big{)}^{2}},\\ v^{\prime}{}_{ij}&=\frac{v_{ij}-\mu}{\sqrt{\sigma^ {2}+\epsilon}}\ast g+k,\end{split}  \tag{10}\]  
where \(\mu\) is the mean value of **V**, \(\sigma\) is the variance of **V**, \(\epsilon\) is a very small decimal number, preventing division by \(0\), \(g\) and \(k\) are trainable parameters to ensure that the normalization operation will not destroy the previous information, \(v_{ij}\) is the element of the \(i\)th row and \(j\)th column of the feature matrix **V**, and \(v^{\prime}{}_{ij}\) is the element of the \(i\)th row and \(j\)th column of the normalized feature matrix **V**\({}^{\prime}\).