# Optical Turbulence Profile Forecasting and Verification in the Offshore Atmospheric Boundary Layer
## 2 Optical Turbulence Forecasting  
### Bpnn  
The backpropagation neural network (BPNN) was developed by [PERSON] et al. as a solution to the problem of training multi-layer perceptions [33]. It is a feed-forward neural network, and its learning process is shown in Figure 1. First, the original data need to be normalized before the initial weight distributions and thresholds of the network are randomly selected. The input and output parameters, and correction errors of each element in the middle layers, are calculated according to the activation function. Then, the connection weights and thresholds for each layer are adjusted based on acquired errors. After that, learning times are updated to determine whether the errors conform to the allowed range. If so, anti-normalization results are output; otherwise, input, output, and errors are recalculated until the error satisfies the demand. As an artificial intelligence neural network, BPNN has many advantages. First, it is fast, simple, and easy to program. Secondly, it has no parameters to tune apart from the numbers of input. Thirdly, it is a flexible method that does not require prior knowledge about the network, and finally, it does not need any special mention of the features of the function to be learned. To simplify the model, the input threshold is set to 0. Suppose that given \(N\) samples, the output of the \(k\) sample at the node \(i\) of the \(l-1\) layer is \(Out_{ik}^{l-1}\). Then, the input of the \(k\) sample at the node \(j\) of the \(l\) layer is:  
\[In_{jk}^{l}=\sum_{i}\omega_{ij}^{l-1}Out_{ik}^{l-1} \tag{1}\]  
where \(Out_{ik}^{l-1}\) represents the output of the node \(i\) of the \(l-1\) layer, when the \(k\) sample is input. \(\omega_{ij}^{l-i}\) represents the weight coefficient from the node \(i\) of the \(l-1\) layer to the node \(j\) of the \(l\) layer. After calculating \(In_{jk}^{l}\), the output of node \(j\) of the \(l\) layer of the \(k\) sample can be calculated:  
\[Out_{jk}^{l}=f\Big{(}In_{jk}^{l}\Big{)} \tag{2}\]  
Among them, \(f\) is used as an activation function and has many manifestations. This article selects the commonly used sigmoid function in BPNN as the activation function, namely:  
\[f(x)=\frac{1}{1+e^{-x}} \tag{3}\]  
Calculate the error according to the specified expected output, where the commonly used error performance function is square:  
Figure 1: Flowchart of the BP neural network. \[E_{k}=\frac{1}{2}{\sum_{j}}{\left({y_{jk}-\overline{y}_{jk}}\right)^{2}} \tag{4}\]  
\(\overline{y}_{jk}\) is the actual output of node j in the output layer, and \(y_{jk}\) represents the expected output. The total error is:  
\[E=\frac{1}{2N}{\sum_{k=1}^{N}{E_{k}}} \tag{5}\]  
Define \(\delta_{jk}^{l}=\partial{E_{k}}/\partial{ln^{l}_{jk}}\) as the partial derivative of the error of the \(k\) sample to the \(j\) node of the \(l\) layer, then the partial derivative of the connection weight is:  
\[\frac{\partial{E_{k}}}{\partial{\omega_{ij}^{l-1}}}=\frac{\partial{E_{k}}}{ \partial{ln^{l}_{jk}}}\frac{\partial{ln^{l}_{jk}}}{\partial{\omega_{ij}^{l}}}= \frac{\partial{E_{k}}}{\partial{ln^{l}_{jk}}}Out^{l-1}_{ik}=\delta_{jk}^{l} Out^{l-1}_{ik} \tag{6}\]  
Subsequent reverse calculation weight correction. First, calculate the weight correction from the \(i\) node in the hidden layer (the \(l\) layer) to the \(j\) node in the output layer (the \(l+1\) layer). Then, calculate the weight correction from the \(h\) node in the input layer (the \(l-1\) layer) to the \(i\) node in the hidden layer. The result is as follows:  
\[\frac{\partial{E_{k}}}{\partial{\omega_{ij}^{l}}}=-Out^{l-1}_{ik}(y_{k}- \overline{y}_{k})f^{\prime}\left({Int^{l}_{jk}}\right) \tag{7}\]  
\[\frac{\partial{E_{k}}}{\partial{\omega_{hi}^{l-1}}}=Out^{l-2}_{hk}{\sum_{j}} \delta_{jk}^{l}{\omega_{ij}^{l}}f^{\prime}\left({Int^{l-1}_{ik}}\right) \tag{8}\]  
where Equation (7) represents the weight correction from the hidden layer to the output layer, and Equation (8) represents the weight correction from the input layer to the hidden layer.