# Neural-Network-Assisted Polar Code Decoding Schemes
## 3 Neural Network-Assisted Polar Code Decoding Scheme
### Neural Network Model and NNN  
The NN model is trained by the training part in Figure 7. We write matrix \(\dot{U}\) with size \(2^{K_{S}}\times K_{S}\) to denote all the possible information sequences and matrix \(\dot{X}\) with size \(2^{K_{S}}\times N_{S}\) to denote all the possible codewords, resulting in, \(\dot{x}_{1}^{N_{S}}\in\dot{X}\). Let \(A\) denote the position set of the information bits. The decoder layer is trained to find the \(\dot{u}_{1}^{K_{S}}\) corresponding to \(\dot{y}_{1}^{N_{S}}\), with \(\dot{u}_{1}^{K_{S}}\in\dot{U}\). To fully train the NN, additional layers without trainable parameters are added to perform certain actions, namely mapping the codewords to BPSK symbols and adding noise. Therefore, the NN model approximates \(\dot{x}_{1}^{N_{S}}\) to \(\dot{u}_{1}^{K_{S}}\). Therefore, \(\dot{X}\) represents the training data in this machine learning problem and \(\dot{U}\) is the label. We can generate as much training data as desired by Monte Carlo simulations. The activation functions used in the decoder layer are sigmoid functions and a rectified linear unit (ReLU), which are defined as follows:  
\[g_{sigmoid}(z)=\frac{1}{1+e^{-z}}, \tag{9}\]  
\[g_{\text{ReLU}}(z)=\max\{0,z\}. \tag{10}\]  
Mini-batch gradient descent is used to train the NN, and in each batch, different data are fed into the NN. Table 1 summarizes the architecture of the proposed NN model. In this scheme, the batch size, which is equal to the size of the label set and that of the codeword set, is \(2^{K_{S}}\). Thus, the training complexity scales exponentially with \(K_{S}\), which makes training the NN decoder for long polar codes not feasible in actuality. To solve this problem, we define the short codes (\(N_{S}\) is generally less than 32) decoded by the NN decoder as NNNs and combine them with the traditional special nodes mentioned in Section 2.2 to derive an NNA decoding scheme. Note that an NNN could be one of the R1, R0, Rep, or SPC nodes, or none of them. [PERSON]'s system polar code coding scheme [35] is used in this paper unless otherwise stated. Figure 7: Block diagram of the NNA decoding scheme. The neural network structure in this paper consists of a mapper layer, a noise layer, and a decoding layer. All three layers need to be trained. In real-life decoding, only the decoding layer is needed. The structure of the NN is shown in Table 1. The mapper layer and the noise layer are both custom-function layers generated by the Keras tool in Tensorflow2. In this paper, Gaussian white noise is used unless otherwise stated; the Gaussian construction method is used to generate polar codes; the modulation method is BPSK. The input of the network during training is \(\dot{X}\). The label is \(\dot{U}\). Each round of training adds different noises, i.e., the data of each round of training are different from each other to prevent overfitting. A trained CNN can classify the received signal, find the corresponding information sequence, and finally decode the polar code. A well-trained neural network can achieve the performance of MAP decoding [26]. The decoding results of the NNN with \(N_{S}=16\) and \(K_{S}=4\) are shown in Figure 8.  
As shown in Figure 8, NNN decoding performance is better than SC algorithm, almost the same as the optimal MAP decoding algorithm, while the traditional fast decoding adopts a suboptimal decoding algorithm, and its decoding performance is similar to SC. Therefore, using well-trained CNN to decode subcodes can obtain better decoding performance than traditional classified subcodes.