# A Deep Learning Method for Short-Term Dynamic Positioning Load Forecasting in Maritime Microgrids
## 2 Review of Artificial Neural Networks
### The Back-Propagation Training Algorithm of MLP  
The multilayered neural network consists of hidden layers and the training method is much more difficult. A key method to adjust the weights of neurons is spread over an MLP model. A single-layered MLP structure shown in Figure 2 contains a single neuron to present the back-propagation training procedure. According to Figure 2, a neuron has been divided into two parts. The first summation part computes the neuron function \(u\), and the second part is the nonlinear activation function \(\hat{y}=f(u)\). The network output \(\hat{y}\) is compared with the desired output value \(y\), and their difference is calculated as an error signal \(e=y-\hat{y}\). Assumed the inputs and outputs samples are \(\{(x(n)),(y(n))\); \(1\leq n\leq n\}\), and the error BP training for feeding \(n\) inputs through the MLP network and calculates the corresponding output \(\hat{y};1\leq n\leq n\}\). Hence, the initial estimate for the weights vector matrix is represented by a summation square error as follows:  
\[E_{b}=\sum_{n=1}^{n}\left[e_{b}(n)\right]^{2}=\sum_{n=1}^{n}\left[y(n)-\hat{y }(n)\right]^{2}=\sum_{n=1}^{n}\left[y(n)-f(wx(n))\right]^{2} \tag{4}\]  
The square error \(E_{b}\) in (4) regulates the weights matrix \(w\) to decrease the error signal. Fundamentally, these algorithms are defined as follows:  
\[w_{i}(t+1)=w_{i}(t)+\Delta w_{i}(t) \tag{5}\]  
where \(w_{i}(t+1)\) is the modified value of the present weights of \(w_{i}(t)\), and \(\Delta w_{i}(t)\) is the form of the differing algorithm in (5). This leads to a problem of optimizing non-linear squares. To reduce the square error \(E_{b}\), the weights matrix-vector is to be adjusted. To solve the problem in (4), there are several types of nonlinear optimization algorithms. Since this is a nonlinear mean square optimization problem, the gradient descent (GD) algorithm regulates the weights corresponding to the gradient error as the basis of the EBP learning algorithm. The derived scalar quantity \(E_{b}\) concerning discrete weights can be defined as follows:  
\[\frac{\partial E_{b}}{\partial w_{i}}=\sum_{n=1}^{n}\frac{\partial[e_{b}(n)]^{ 2}}{\partial w_{i}}=\sum_{i=1}^{i}2[y(n)-\hat{y}(n)](\frac{-\partial\hat{y}(n )}{\partial w_{i}}) \tag{6}\]  
Figure 2: A Single neuron for back-propagation training MLP model. where  
\[\frac{\partial^{\wedge}_{y}(n)}{\partial w_{i}}=\frac{\partial f(u)}{\partial u} \cdot\frac{\partial u}{\partial w_{i}}=f^{\prime}(u)\frac{\partial}{\partial w_ {i}}\sum_{i=1}^{n}w_{i}x_{i}+w_{nb}=f^{\prime}(u)x_{i} \tag{7}\]  
Hence  
\[\frac{\partial E_{b}}{\partial w_{i}}=-2\sum_{n=1}^{n}\big{[}y(n)-\overset{ \wedge}{y}(n)\big{]}f^{\prime}(u(n))x_{i}(n) \tag{8}\]  
With \(\delta(n)=[y(n)-\overset{\wedge}{y}(n)]f^{\prime}(u(n))\), the (8) commutes as  
\[\frac{\partial E_{b}}{\partial w_{i}}=-2\sum_{n=1}^{n}\delta(n)x_{i}(n) \tag{9}\]  
where \(\delta(n)\) is the error signal \(e=y-\overset{\wedge}{y}\) reduced through the derivative of the activation function. Therefore, the number of modifications is required to be adopted to the weight \(w_{i}\) for the given input \(x_{i}(n)\). Consequently, an MLP with a single layer of the neuron is adjusted based on the overall weight change in (5) as the following formula:  
\[w_{ij}(t+1)=w_{ij}(t)+\eta\sum_{n=1}^{n}\delta(n)x_{i}(n) \tag{10}\]  
where \(\delta(n)\) is the error signal of output, as determined by:  
\[\delta(n)=\partial E_{b}/\partial u=[y(n)-\overset{\wedge}{y}(n)].\overset{ \wedge}{y}(n).[1-\overset{\wedge}{y}(n)] \tag{11}\]  
To perform the tuning of the weights in MLP, new symbolizations in Figure 3 are assumed to individual neurons at diverse layers. The network active function and their outputs corresponding to the training term \(k\)th of the \(j\)th neuron in the \((l-1)\) layer are indicated by \(u(n)_{i}^{(l-1)}\) and \(\overset{\wedge}{y}(n)_{j}^{(l-1)}\), respectively.