## 3 Proposed Method
### Peso
#### 3.3.2 Parallel Encoders  
Recurrent neural networks are widely utilized in time-series problems, especially when the variant LSTM appears. LSTM is an extended variant of RNNs with a forgetting gate and a memory cell. The network design ensures that LSTM is capable of learning the long-term temporal dependencies on those time-series data. Normally, an LSTM network comprises several sections, including input data, hidden state, cell memory, model layer, and so on. The detailed calculation process of LSTM can be represented by the following formula, where \(f_{t}\), \(i_{t}\), \(C_{t}\), and \(h_{t}\) denote the forget gate, input gate, cell memory, and hidden state at the time of \(t\), and \(x_{t}\), \(C_{t-1}\), and \(h_{t-1}\) are the input data at the time of \(t-1\); \(\sigma\) is the sigmoid function, and \(tanh\) is the tanh activation function, while \(W\) and \(b\) are the learnable parameters in LSTM. \(*\) denotes an element-wise product.  
\[\begin{split} ccf_{t}&=\sigma(W_{f}\cdot(h_{t-1};x_{t })+b_{f})\\ i_{t}&=\sigma(W_{i}\cdot(h_{t-1};x_{t})+b_{i})\\ \widehat{C}_{t}&=tanh(W_{C}\cdot(h_{t-1};x_{t})+b_{ C})\\ C_{t}&=f_{t}*C_{t-1}+i_{t}*\widehat{C}_{t}\\ o_{t}&=\sigma(W_{o}\cdot(h_{t-1};x_{t})+b_{o})\\ h_{t}&=o_{t}*tanh(C_{t})\end{split} \tag{5}\]  
The Parallel Encoders are targeted to make the networks capture more feature information by using different encoders, obtaining multiple feature representations. The Parallel Encoders embed different types of features at the same time, avoiding the noise inside the features when only an encoder is used, and enrich feature representations. Both encoders in PESO adopt the network of LSTM with five layers. One is the Location Encoder which is specifically designed to embed the position into high-dimensional features. The other is the Sailing Status Encoder, which deals with status information, such as speed, course, and sailing distance.  
The Location Encoder \(E_{loc}\) sends the input data consisting of normalized longitude and latitude into the network and outputs the hidden state \(h_{loc}\) and cell memory \(c_{loc}\) which contain the location feature. The input sequence of the Location Encoder is \(X_{loc}=(loc_{1};loc_{2};\ldots;loc_{10})\), where \(loc_{i}=(lon_{i};lat_{i})\), \(i=1,2,\ldots 10\), and \(X_{loc}\in\mathbb{R}^{10\times 2}\).  
\[h_{loc},c_{loc}=E_{loc}(X_{loc}) \tag{6}\]  
The Sailing Status Encoder \(E_{sail}\) uses the speed, course, and sailing distance of the vessel as inputs to the network, outputting hidden state \(h_{sail}\) and cell memory \(c_{sail}\). Similarly, the input sequence of the Sailing Status Encoder is \(X_{sail}=(sail_{1};sail_{2};\ldots;sail_{10})\), where \(sail_{i}=(cog_{i};sog_{i};dis_{i})\), \(i=1,2,\ldots 10\) and \(X_{sail}\in\mathbb{R}^{10\times 3}\). \(h_{sail}\), and \(c_{sail}\) represent the sailing status information of the ship.  
\[h_{sail},c_{sail}=E_{sail}(X_{sail}) \tag{7}\]Note that \(h_{loc}\), \(c_{loc}\), \(h_{sail}\), and \(c_{sail}\in\mathbb{R}^{layers\times batchsize\times hidden}\). Finally, for better fusion of features, we add the hidden states and the cell memories of the two encoders to obtain the final result:  
\[h_{enc} =h_{loc}+h_{sail} \tag{8}\] \[c_{enc} =c_{loc}+c_{sail}\]