# Improving Streaming Video with Deep Learning-Based Network Throughput Prediction
## 4 Prediction of Network Throughput
### Long Short-Term Memory Networks  
An LTSM is a recurrent ANN, which can learn long-range dependencies in data. LSTM ANNs respond to the short-term memory problem of recurrent ANNs. Namely, a recurrent ANN has difficulties retaining data from earlier computations because it misses information about long-memory dependencies. An LSTM ANN handles this problem by allowing its memory cells to select when to forget certain information, thus achieving the optimal time lags for time series problems. For this purpose, a network uses a memory block, which contains cells with self-connections, memorizing the temporary state and three adaptive, multiplicative gates (input, output and forget) to control information flow in the block--see Figure 3. The gates can learn to open and close, enabling LSTM memory cells to store data over long periods, which is desirable in time series prediction with long temporal dependency. Multiple memory blocks form a hidden layer. An LSTM ANN consists of an input layer, at least one hidden layer and an output layer. An LSTM's cell takes three inputs and generates two outputs:  
\[(h_{t},c_{t})=\text{CL}(h_{t-1},c_{t-1},x_{t}),\]  
where \(x_{t}\) is an element of time series, \(c_{t-1}\) is a cell's memory signal from the previous time \(t-1\), and \(h_{t-1}\) is a cell's output signal at the previous time \(t-1\). At the time \(t\), the cell generates two signals: \(c_{t}\)--a cell's state and \(h_{t}\)--a cell's output, which is passed to an upper ANN layer. At every time step, the element \(x_{t}\) of a time sequence enters the cell. Both output signals \(h_{t}\) and \(c_{t}\) leave the cell at time \(t\) and return to that same cell at a time \(t+1\). The cell can multiply or add signals, which are denoted by the symbols \(\times\) and \(+\). Cell gates also use two functions: _sigm_ and _tanh_. The first represents the sigmoid function, which outputs numbers between zero and one (\(\text{sigm}:R\rightarrow[0,1]\)), describing how much of each signal to let through. The value of zero transfers nothing, while a value of one transfers everything. The second function represents the hyperbolic tangent \(\tanh:R\rightarrow[-1,1]\)) and denotes which fraction of the candidate value \(\zeta_{t}\) updates the cell's state \(c_{t-1}\). An entering signal simultaneously reaches all three cell's gates. The _forget gate_ decides which part of the memory from the previous state transfers to the current state. The gate multiplies the signal using its weight \(w_{f}\) and projects it into a unit interval using a sigmoid function  
\[f_{t}=\text{sigm}(w_{f}[h_{t-1},x_{t}]+b_{f}).\]  
The remaining two gates determine which new information to store in the cell. Firstly, the _input gate_ decides which values to update, transforming them into a unit interval. Next, the _tanh_ layer creates a new candidate value \(\zeta_{t}\) and adds it to the cell state later. \[i_{t}= \text{sigm}(w_{i}[h_{t-1},x_{t}]+b_{i}),\] \[\zeta_{t}= \text{tanh}(w_{C}[h_{t-1},x_{t}]+b_{c}).\]  
Figure 3: Structure of LSTM memory block: \(x_{t}\) is an input signal at the time \(t\), \(c_{t-1}\) and \(c_{t}\) represent cell states at the previous \(t-1\) and actual \(t\) times, \(h_{t-1}\) and \(h_{t}\) are output signals of the cell at \(t-1\) and \(t\) times, \(b\) represents the bias. The symbol \(\times\) represents the multiplication and \(+\) summation of signals. Finally, the new state \(c_{t}\) replaces the old one \(c_{t-1}\): the old state \(c_{t-1}\) multiplies the _forget gate_ value \(f_{t}\), and the candidate result \(\tilde{c_{t}}\) multiplies the _input gate_ value \(i_{t}\)  
\[c_{t}=f_{t}\times c_{t-1}+i_{t}\times\tilde{c_{t}}. \tag{8}\]  
Equation (8) controls the amount of information \(c_{t}\), which will form the state of the cell at the time \(t\).