# GAO-FCNN-Enabled Beamforming of the RIS-Assisted Intelligent Communication System
## 3 Gao-Fnn  
### Fully-Connected Neural Network  
The FCNN is based on the connection weights and bias between neurons, as well as the nonlinear properties of the activation mechanism. And these weight values and biases are combined with the neural network via a linear process. This is followed by a nonlinear transformation applied by the activation function. This combination enables the network to perform the complex feature extraction and pattern recognition according to the input data. As a result, the network is able to map the input data to the corresponding output labels, and learn some provided examples effectively. After then, to retrieve the original bit sequence of the time-dependent channel, the minimization of the cross-entropy (CE) loss function is performed during the training process. It is expressed as  
\[\psi(\mathbf{t},\mathbf{\tilde{t}})=-\frac{1}{T}\sum_{i=1}^{T}\sum_{k=1}^{K} \left(t_{k}^{(i)}\ln\tilde{t}_{k}^{(i)}+(1-t_{k}^{(i)})\ln(1-\tilde{t}_{k}^{( i)}),\right. \tag{9}\]where \(\psi(\mathbf{t},\mathbf{\tilde{t}})\) is the CE loss function, \(T\) is the quantity of training samples and it is utilized to evaluate \(\psi(\mathbf{t},\mathbf{\tilde{t}})\), \(\mathbf{t}=\left\{t_{1},t_{2},\ldots,t_{k},\ldots,t_{K}\right\}\in\left\{0,1 \right\}^{K}\) is the input bit sequence, \(K\) is the number of the bit sequence, and \(\mathbf{\tilde{t}}=\left\{\tilde{t}_{1},\tilde{t}_{2},\ldots,\tilde{t}_{k}, \ldots,\tilde{t}_{K}\right\}\in\left\{0,1\right\}^{K}\) is the soft bit sequence. Next, the input bit sequence \(\mathbf{t}=\left\{t_{1},t_{2},\ldots,t_{k},\ldots,t_{K}\right\}\in\left\{0,1 \right\}^{K}\) is subjected to a transformation process involving three fully connected layers. The first layer is employed using the ReLU activation function [31] and the undergoing BatchNorm1d normalization just as it is shown in Algorithm 1 to carry on the linear transformation. In addition, the activation function is also computed here. Finally, the activation value of the first output layer is given by  
\[\left\{ \begin{array}{l}\mathbf{\upxi}^{(1)}=\text{BatchNorm}\text{L}(\text{ ReLU}(\mathbf{W}_{i}^{(1)}t_{k}+e^{(1)}))\\ \boldsymbol{\alpha}^{(1)}=sig(\mathbf{\upxi}^{(1)})\end{array} \right., \tag{10}\]  
where \(\mathbf{\upxi}^{(1)}\) is the activation value vector of the first layer, \(\mathbf{W}_{i}^{(1)}\) is the first weight vector of the \(i\)-th training sample, \(e^{(1)}\) is the bias of the first layer, \(\boldsymbol{\alpha}^{(1)}\) is the predicted output of the first layer, \(sig(\mathbf{\upxi}^{(1)})\) is the sigmoid activation function in the first layer, and the BatchNorm1d normalization is provided by  
\[\text{BatchNorm}(q)=\frac{x-E(q)}{\sqrt{Var(q)+\mathbf{\upvarepsilon}}}\times \gamma+\beta, \tag{11}\]  
where \(q\) is the data entered into the BatchNormld layer, and it is usually the characteristic data within a lot (batch); \(E(q)\) is the mean value of the input data in a certain dimension; \(Var(q)\) is the variance of the input data \(x\) with the same dimension; \(\mathbf{\upvarepsilon}\) is a very small positive  
sample, \(\mathbf{y}\) is the signal obtained at the receiver via the direct connection without RIS and the RIS-assisted channel links, \(e_{i}^{(1)}\) is the first bias of the \(i\)-th training sample, \(e_{i}^{(2)}\) is the second bias of the \(i\)-th training sample, and \(\dot{\alpha}_{i}\) represents the output of the \(i\)-th training sample after passing through the second layer. Here, the transmitter, the channel, and the receiver are implemented as auto encoders using this FCNN. The trainable weight values are trained by using both \(\varphi_{m}\in(0,2\pi]\), \(m=1,2,\ldots,M\) and \(\beta_{m}\in[0,1],m=1,2,\ldots,M\) to link neighboring layers. The network modeling parameters of both the transmitter and the receiver are fine-tuned to concurrently recreate the inputs of the transmitter at the receiving side.