# Traffic Noise Prediction Applying Multivariate Bi-Directional Recurrent Neural Network
## 2 Materials and Methods
### Architectures of RNN  
Different types of RNN architectures could be trained, depending on the needs of the concrete problems, such as one-to-many for music generation [38], many-to-one for sentiment classification [39], sequence-to-sequence for machine translation [40], etc. With regards to the type of sequence-to-sequence, it can be further classified into subgroups, according to the lengths of input and output of the model. In this paper, the following notations are used: encoder-decoder architecture for scenarios, where the lengths of the input and output are not the same; many-to-many architecture for scenarios, where the lengths of the input and output are the same. In this work, traffic noise is the output of the model and multiple traffic feature variables are the inputs of the model. At each time step, the input traffic features are expected to predict a corresponding output traffic noise level. This problem can be formulated by following three different architectures as illustrated in Figure 5, where n_steps is the length of the sequence, m is the number of training samples, n is the number of feature variables. Please be aware that the grey round-shape nodes in different layers inside Figure 5 represent the recurrent units as discussed above, which could be simple RNN, LSTM or GRU.  
Figure 5: _Cont._  
The traffic noise modelling with the Blansko dataset can be constructed as a many-to-one problem (Figure 5a), when vectorizing each single output of a sequence, so that they can be treated as elements of one vector, corresponding to different time steps. However, in this way, the advantage of recurrent neural network for handling time series data is not thoroughly exploited, because the consideration of time dimension is discarded, due to vectorization. The problem can also be structured as a many-to-many architecture (Figure 5b). This is the most intuitive and intrinsic way to describe this problem. At each time step, along with the input feature variables, a corresponding traffic noise output is expected. The length of the output is equal to the length of the input. On the other hand, although encoder-decoder architecture is a general solution to problems, where the lengths of output and input are not equal, it can be indeed also applied to problems, where the length of output and input equals each other (Figure 5c), namely to this problem  
Figure 5: The appropriate RNN model architectures for traffic noise modelling, based on Blansko data: (**a**) Many-to-one architecture: sequence input and single output. (**b**) Many-to-many architecture: synced sequence input and sequence output. (**c**) Encoder–decoder architecture: sequence input and sequence output (not necessary to be synced).  
of Blansko data modelling. Different from many-to-many architecture, in the encoder-decoder architecture, only the hidden state from last time step of a recurrent layer will be sent to next layer [41]. This allows the applicability of encoder-decoder architecture to problems, where the lengths of input and output of the sequence are not equal.