## 4 Convolutional/LSTM-Based Resource Allocation Framework
### Convolutional/LSTM Neural Network  
The neural network architecture is illustrated in Figure 2. It is composed by six stages referred to as normalization, convolutional, flatten, LSTM, feed-forward and de-normalization. The normalization layer provides to normalize in the range [0, 1] the measured processing capacities; Let us denote with \(\mathbf{c}_{j}^{a}\) and \(\mathbf{c}_{j}^{a,nor}\) the vector of the measured processing capacities and the one of their normalization, respectively, in the \(j\)-th MI for the NFVI-PoP \(\bar{u}\in\bar{\mathcal{U}}_{NP}\). The normalized processing capacity vector \(\mathbf{c}_{j}^{a,nor}\) is evaluated according to the following expression:  
\[\mathbf{c}_{j}^{a,nor}=\frac{1}{C_{max}-C_{min}}(\mathbf{c}_{j}^{a}-C_{min} \mathbf{0}_{N_{NFI}^{a}}) \tag{2}\]  
\[j\in[n..n-L+1]\]  
where \(\mathbf{0}_{N_{NFI}^{a}}\) denotes a ones' vector of size \(N_{VNFI}^{a}\), \(C_{min}\) and \(C_{max}\) denote the minimum and maximum processing capacities, respectively. The 1-D convolutional layer aims at extracting the spatial features; convolutions are performed between the normalized capacity vector \(\mathbf{c}_{j}^{a,nor}\) and \(N_{F}\) Kernel filters referred to as \(\mathbf{k}_{i}\)\(i\in[1..N_{F}]\). The convolution vectors \(\mathbf{d}_{j,i}^{a}\) are evaluated according to the following expression:  
\[\mathbf{d}_{j,i}^{a}=\mathbf{c}_{j}^{a,nor}\otimes\mathbf{k}_{i}\ \ j\in[n..n-L+1];i\in[1..N_{F}] \tag{3}\]  
where the symbol \(\otimes\) denotes the convolution operator. The size of the vectors \(\mathbf{d}_{j,i}^{a}\) (\(j\in[n..n-L+1];i\in[1..N_{F}]\)) equals \(N_{VNFI}^{a}-S_{F}+1\) if Kernel of size \(S_{F}\) are used. The outputs of the 1-D convolutional layer are the matrices \(\mathbf{D}_{j}^{a}\)\(j\in[n..n-L+1]\); each of them has as rows the convolution vectors evaluated in the corresponding monitoring interval. As the input of each LSTM cell accepts only vectors, the LSTM layer is preceded by a flatten one whose function is to place for the \(j\)-th monitoring interval the rows of the matrix \(\mathbf{D}_{j}^{a}\) in the vector \(\mathbf{x}_{j}\) of size \((N_{VNFI}^{\bar{u}}-S_{F}+1)N_{F}\). The LSTM layer is used to handle the temporal correlations. LSTM is a variant of the recurrent neural network (RNN), has special designs for overcoming the gradient  
Figure 2: Convolutional/LSTM neural network for the processing resource allocation in the NFVI-PoP \(a\in\bar{\mathcal{U}}_{NP}\). vanishing problem that troubles conventional RNNs. LSTMs have shown their strength in handling sequential data, and have been applied successfully in various tasks, such as image captioning,language modeling, video analysis [31] etc. The LSTM layer has as inputs the vectors \(\mathbf{x}_{j}\)\((j\in[nS..nS-L+1])\). The final output \(\mathbf{h}_{nS}\) is processed by a feed forward neural network which evaluates the vector \(\mathbf{\hat{c}}_{nS}^{a,nor}\) of normalized processing capacity values. In the LSTM Cell Block \(LCB_{j}\), shown in Figure 3, the state variable \(\mathbf{s}_{j}\)\((j\in[nS..nS-L+1])\) in the \(j\)-th MI is updated according to the knowledge of the spatial feature \(\mathbf{x}_{j}\) evaluated in the \(j\)-th MI, the output \(\mathbf{h}_{j-1}\) and the state variable \(\mathbf{s}_{j-1}\) of the LSTM Cell Block \(LCB_{j-1}\). The LSTM innovative idea is to introduce the forget and input gates that decide which components of the state vector have to be deleted (forget gate) and preserved (input gate). An output gate is also introduced that controls what information encoded in the state variable is sent to the output \(\mathbf{h}_{j}\) of the LSTM Cell Block \(LCB_{j}\). The updating of the state \(\mathbf{s}_{j}\) and the evaluation of the output \(\mathbf{h}_{j}\) are performed according to the following expressions:  
\[\left[ \begin{array}{c}\mathbf{i}_{j}\\ \mathbf{f}_{j}\\ \mathbf{o}_{j}\end{array} \right]=\sigma\left(\left[ \begin{array}{cc}\mathbf{ W}_{ix}&\mathbf{W}_{ih}\\ \mathbf{W}_{fx}&\mathbf{W}_{fh}\\ \mathbf{W}_{ox}&\mathbf{W}_{oh}\end{array} \right]\left[