## 4 Development of MLMs for Hybrid Seismic Analysis  
### Framework for Developing and Testing the MLMs  
As explained previously, the MLM is developed to predict the shear time history given the displacement time history of the target isolation layer. The MLM input and output are time sequences whose lengths may be very long considering the very small time-step commonly adopted for accurate and stable NTHAs. The sequence length is variable as the duration of the GMs. Hysteresis behavior may depend on many parameters and phenomena; thus, patterns in data may be difficult to describe. Considering the aforementioned conditions, one of the favorite machine learning algorithms to adopt for this study is the RNN, which is designed to deal with sequence data and to infer patterns automatically in data. This paper proposes an innovative application of RNNs in civil engineering rather than descriptions or advances into their algorithms. For a brief and basic presentation of common recurrent units/cells, the reader may refer to provided reference [24]. To develop and test RNN models, Figure 4 summarizes the five Stages proposed in this study: (1) Generating artificial data, (2) data preprocessing, (3) tune model architecture, (4) tune learning behavior, and eventually (5) test the developed model on new unseen data corresponding to GMs 3, 4, and 5. **Stage 1**: Given the displacement time history of the target isolation layer (NRB + LRB + Oil Damper), the MLM would predict the corresponding shear force-time history. Samples of displacement/shear time histories need to be generated by performing NTHAs of the equivalent 1 DOF system having a deformation and velocity-dependent hysteresis behavior as presented in Table 2. Natural periods and inherent viscous damping are chosen randomly with the goal to reach the displacement limit of the target isolation layer (here, fixed to 25 cm). Data derived from GMs 1 and 2 are used to develop the MLMs (Stages 3 and 4), and those corresponding to GMs 3, 4, and 5 are used for testing (Stage 5). The five seconds duration of GM 1 is chosen for the only reason to optimize the computation time of Stage 3. Even though a large artificial dataset could be generated, only 50 Samples are produced intentionally to simulate often-faced cases of a small experimental dataset. Figure 3: Acceleration response spectra of used earthquake ground motions (damping h = 5%). **Stage 2**: Training ANNs needs as much clean data as possible. Artificial samples generated in this study are supposedly clean. A data augmentation technique is performed to offer a solution for the intentionally generated small dataset: One-second splitting and 0-padding of sequences through time were enough to feed Stage 3 with 250 samples and Stage 4 with 750 samples. These training datasets are scaled by the maximum absolute value to be within the range \([-1,1]\) to avoid any exploding or vanishing gradient descent during the backpropagation process [25] in training. Then, datasets are shaped into 3-dimensional vectors: Samples, time steps, features. The test data are scaled and shaped similarly, but no size augmentation is needed. **Stage 3**: ANNs are stochastic models. The same architecture trained by the same data and with the same hyperparameters leads to different predictions. The randomness of both network weights initialization and splitting to training and validation data generates an aleatory uncertainty. All candidate architectures are trained many times, and their final performances are summarized in a Box and Whisker plot to select the most appropriate one based on accuracy and precision. Ten acts of training (runs) per case are performed for the first level screening to choose between the two most common types of RNN cells: The Long Short-Term Memory (LSTM) [13] and the Gated Recurrent Unit (GRU) [26]. Then, 20 acts of training per case are performed for the second level screening to select the network architecture.