## 5 Performance Evaluation of the RNN Simulation Model  
The weights and biases of the RNN model were optimized using the training dataset for 1000 epochs in this study. Because each earthquake in Table 2 had 6000 time-steps for a duration of 30 s, one epoch for RNN model training had 60,000 data points. Because the data were too numerous to feed to the computer at once, the training dataset of 60,000 points was divided into batches of 6000, then it took 10 iterations to complete 1 epoch. Each iteration means the training for each earthquake. The weights and biases of the RNN model were updated at the end of every iteration, to fit them to the training data given. All numerical simulations for training the RNN model were implemented using Python 3.5.0 and Tensorflow 1.6.0. In the context of an optimization algorithm, the function used to evaluate a candidate solution (i.e., in this study, a set of weights and biases for RNN) is referred to as the objective function. In neural networks, the objective function is typically referred to as a loss function, and the value calculated by the loss function is referred to as simply the 'loss'. The RNN model is trained using an optimization process that requires a loss function to calculate the model error. The model error is usually calculated by matching the target (actual) values and predicted values by the RNN. The target values of the RNN model were the seismic responses of the FE model with the Bouc-Wen model, as explained in the previous section. The two implemented RNN models utilized in this study used the sum of squared errors as the loss function to be minimized for the training process. The root mean squared error (RMSE), which is a commonly used metric to evaluate forecast accuracy, was employed to verify the trained RNN model. The error measures are defined as follows:  
\[loss=\sum_{i=1}^{n}{(p_{i}-y_{i})}^{2}, \tag{2}\]  
\[RMSE=\sqrt{\frac{1}{n}{\sum_{i=1}^{n}{(p_{i}-y_{i})}^{2}}}, \tag{3}\]  
where, \(n\) is the number of data (i.e., number of time-steps), \(p_{i}\) is the predicted responses of the RNN model, and \(y_{i}\) is the target responses of the FE model. Hyperparameter tuning and the selection of a proper function are challenging tasks to develop the accurate RNN model for time series data prediction. Table 3 lists the default hyperparameter values and function used for training and evaluation of the RNN simulation model. Long Short-Term Memory networks (LSTM) [39], which are a special kind of RNN, were used. They work tremendously well on a large variety of problems, due to their capability of learning long-term dependencies, and are now widely used. The hyperbolic tangent (indicated by tanh) was used as the default activation function of the LSTM RNN model. The optimization algorithm employed was the Adam optimizer with a learning  
Figure 6: Time histories of input data for RNN: (**a**) Ground acceleration time history of artificial earthquake 1 (EQ No. 6); (**b**) Command voltage time history. rate of 0.01. The Adam optimizer is a popular optimization algorithm in the field of deep learning, because it achieves good results fast compared to the classical stochastic gradient descent procedure. An issue to be considered with the RNN model is that it can easily overfit training data, resulting in reduction of its predictive capacity. When the RNN model is trained, it can be used to simulate having a large number of different network architectures, by randomly dropping out nodes. This is termed 'dropout', and offers a very computationally cheap and remarkably effective regularization method to reduce overfitting and improve the RNN model performance. The dropout rate of 1.0 means no dropout, while 0.0 means no outputs from the layer. A good value for dropout is known to be between (0.5 and 0.8). In this paper, the dropout rate of 0.8 was used in the training process, while 1.0 was used in the verification process. Increasing the number of LSTM cells increases the representational performance of the RNN model, yet makes it prone to overfitting.