# Instantaneous Beam Prediction Scheme against Link Blockage in mmWave Communications
## 4 Proposed LSTM-Based Recovery Scheme
### Operating Modes
Initially, the cell state \(s_{t}\), at time \(t\) determines information fed to the next sequence is modified by \(g_{t}^{f}\) (remember vector) in the sigmoid layer, which is adjusted by \(g_{t}^{mod}\) that delivers the new candidate cell state. The forget gate then has the following inputs. A hidden state vector \(\eta_{t-1}\) during the (\(t\)\(-\)1) th time step, along with an input vector at the (\(t\)) th time step, \(x_{t}\). This gate then returns a number between 0 and 1 for each number in the previous cell state at the (\(t\)\(-\)1) th time step, \(s_{t-1}\). Specifically, the output of \(g_{t}^{f}\) specifies the information that the cell state need to forget or discard, i.e., by multiplying 0 to a specific position in the matrix. If the output of the remember vector \(g_{t}^{f}\) is 1, then the cell state maintains this information. A sigmoid function, \(\sigma_{g}\) is applied here to the weighted input and previous hidden state. Equations (11)-(15) represent the cell state \(s_{t}\), and gates \(g_{t}^{f}\), \(g_{t}^{in}\), \(g_{t}^{mod}\), and \(g_{t}^{out}\) all at time step \(t\), i.e.,  
\[s_{t} =g_{t}^{f}s_{t-1}+g_{t}^{in}g_{t}^{mod}, \tag{11}\] \[g_{t}^{f} =\sigma_{g}(W_{f}(\eta_{t-1},\ x_{t})+\beta_{f}),\] (12) \[g_{t}^{in} =\sigma_{g}(W_{in}(\eta_{t-1},\ x_{t})+\beta_{in}),\] (13) \[g_{t}^{mod} =\tanh(W_{s}(\eta_{t-1},\ x_{t})+\beta_{c}),\] (14) \[g_{t}^{out} =\sigma_{g}(W_{out}(\eta_{t-1},\ x_{t})+\beta_{out}). \tag{15}\]  
Parameters \(W_{f}\), \(W_{in}\),\(W_{out}\), \(W_{s}\) are the weight matrices and \(b_{f}\), \(\beta_{in}\), \(\beta_{c}\), \(\beta_{out}\) are the bias vectors for the \(g_{t}^{f}\), \(g_{t}^{in}\) and \(g_{t}^{out}\) gates and the cell state, respectively, acquired during the training mode. Lastly, the hidden state layer \(\eta_{t}\) is expressed as \(\eta_{t}\)=\(g_{t}^{out}\).tanh(\(s_{t}\)). See Table 5 for a complete list of notations for the LSTM network. \begin{table}
\begin{tabular}{c l} \hline \hline
**Notation** & **Variable** \\ \hline \(g_{t}^{in}\) & Input gate \\ \(g_{t}^{mod}\) & Input modulation \\ \(g_{t}^{t}\) & Forget gate \\ \(g_{t}^{out}\) & Output gate \\ \(T_{train}\) & Training period \\ \(\beta_{in}\) & Bias vectors for the input gate \\ \(\beta_{c}\) & Bias vectors for the cell state \\ \(\beta_{out}\) & Bias vectors for the output gate \\ \(b_{f}\) & Bias vectors for the forget gate \\ \(\eta_{t}\) & hidden state layer \\ \(W\) & Weight matrices \\ \(n_{o}\) & Output units \\ \(n_{c}\) & Number of the memory cells \\ \(n_{i}\) & Input units \\ \(O(W)\) & Computational complexity for LSTM per weight in a single time step \\ \(Y\) & Actual ground truth \\ \(\hat{Y}\) & Prediction vector \\ \(U\) & Number of predictions points \\ \hline \hline \end{tabular}
\end{table} 
Table 5: List of notations for the LSTM network. The LSTM network iteratively maps an output sequence for each input sequence from \(t=1\) to \(T\) by calculating the unit activations, as per [33],  
\[W=n_{c}\times n_{c}\times 4+n_{i}\times n_{c}\times 4+n_{c}\times n_{o}\ +n_{c}\times 3, \tag{16}\]  
where the term \(W\) denotes the weight matrices (from the input gate to the input), \(n_{c}\), \(n_{i}\) and \(n_{o}\) denote in order the number of the memory cells (number of memory blocks), input units, and the output units. Overall, the key parameters in this learning and training phases include the logistic _Sigmoid_ and the hyperbolic _tanh_ nonlinear activation function used for the gates to estimate the output. Specifically, the input gate is modeled as a _sigmoid_ function with a range \(\in\) [0,1] (adding memory only without forgetting), as the equation is a summation of the previous cell state. As a result, the gate \(g_{t}^{mod}\) is activated with a _tanh_ activation function with a [\(-\)1, 1] range to enable the cell state to forget memory. Training Phase: The training settings here are composed of 4 hidden layers and 50 LSTM units per each layer. The drop-out regularization rate in each layer is set at 0.2.