## 4 NN-Based Joint Equalization and Detection
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Block** & **Type of Fading** & **Width of a Block** \\ \hline \(\begin{bmatrix}A_{1},C_{2}\end{bmatrix}\) & Selective fading & \(W_{\rm c}\) \\ \([A_{1},B_{1}]\), \([B_{2},C_{2}]\), \([C_{3},D_{3}]\) & Flat fading & \(2W_{\rm c}/3\) \\ \([A_{1},A_{3}]\), \([C_{1},C_{3}]\), \([D_{1},D_{3}]\) & Flat fading & \(W_{\rm c}/2\) \\ \([B_{1},B_{3}]\) & Selective fading & \(W_{\rm c}/2\) \\ \([A_{1},A_{2}]\), \([A_{3},B_{1}]\) & Flat fading & \(W_{\rm c}/3\) \\ \([B_{2},B_{3}]\), \([C_{1},C_{2}]\) & Flat fading & \(W_{\rm c}/3\) \\ \([C_{3},D_{1}]\), \([D_{2},D_{3}]\) & Flat fading & \(W_{\rm c}/3\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Fading situations of different sections. where \(g(\cdot)\) is the activation function. To transform \(\mathbf{Y}_{\text{m}}\) to the output with required length, another linear map is built:  
\[\mathbf{Y}=\mathbf{Y}_{\text{m}}{}^{\text{H}}\mathbf{W}_{\text{out}}+\mathbf{B} _{\text{out}}, \tag{18}\]  
where \(\mathbf{W}_{\text{out}}\) and \(\mathbf{B}_{\text{out}}\) are weights and bias of the output layer. \(\mathbf{Y}\) contains \(N_{\text{c}}\) symbols, which are further input with the one-hot format reference symbols to calculate the cross entropy as the loss function, yielding  
\[L_{D}=-\sum_{i}^{B}\sum_{j}^{M}S_{ij}^{onehot}(n)\log\Bigl{\{}\text{softmax} \Bigl{[}Y_{ij}^{\text{s}}(n)\Bigr{]}\Bigr{\}}, \tag{19}\]  
where \(S_{ij}^{onehot}(n)\) and \(Y_{ij}^{\text{s}}(n)\) are the one-hot reference symbol and the corresponding output data. \(M\) is the modulation order; \(\text{softmax}[\cdot]\) is a function to map \(Y_{ij}^{\text{s}}(n)\) to the range \((0,1)\)[28]. The use of cross entropy can make the network converge quickly. Training strategy: For each \(N_{\text{c}}\), there are two tasks for the network. One is to find the optimal \(N_{\text{L}}\) and another is to train the parameter matrix \(\mathbf{D}\). Both tasks can be finished offline with one training. Figure 6 shows the training strategy of the network. The samples are constructed with three parts: random data symbols, different types of channels and noise. The channel samples contains Rayleigh distributed ones and underwater acoustic channels collected in the pool, artificial lake, and WuyuanWay, Xiamen, while the noise includes Gaussian distributed noise and impulsive noise generated by the GAN in [41]. The network for the given input dimension is trained with the range \([N_{\text{bottom}},N_{\text{up}}]\) processed with a step to find the optimal number of neurons \(N_{\text{Lopt}}\). \(N_{\text{bottom}}\) and \(N_{\text{up}}\) are lower and upper bound of the possible \(N_{\text{Lopt}}\), respectively. Meanwhile, the optimal weight matrix \(\mathbf{D}_{\text{opt}}\) trained with \(N_{\text{Lopt}}\) is memorized. Then both \(\mathbf{D}_{\text{opt}}\) and \(N_{\text{L}}\) are delivered to the online network to detect the real received symbols. Online applications: Unlike the NN-based detector, which takes the only the received symbol as the input, the estimated channel is included in the input in the proposed detector. This configuration offers more information for the network to detect symbols, determining a low-complexity semi-analytical detection network, which is generalized to different channels. Therefore, the final goal of this study was to train the networks which could be independently applied online without retraining. The simulations and experiments are described and discussed below to demonstrate the performance of the proposed structure.