## 5 Feasibility Study Through System Simulations
### Simulation Process
#### 5.6.3 Execution Flow of the Model Training Function
For the methods 1-SingFingIn-PosOut and 3-MultFingIn-PosOut, the position of the central sub-tile in a tile is considered the reference target training position (the selection of the central sub-tile is discussed in Section 4.4.1). For the method 2-SingFingIn-AggPosOut, the position of each one of the sub-tiles is considered the target training position. The fourth pattern-matching method, 4-MultFingIn-ClassOut, is based on classification of the tiles. In this case, the one-hot-encoded vectorization of the tile-class label is used as the training target. It is noted that in methods 1-SingFingIn-PosOut and 3-MultFingIn-PosOut, the target training position can be the same as the target reference position for the calculation of the positioning error. However, in the method 2-SingFingIn-AggPosOut, in contrast to pattern-matching methods one and three, multiple sub-tile center position estimates are aggregated. Then, the final position estimate used by us is the center of the tile, given by the aggregation performed in Equations (2) and (3). Thus, in the method 2-SingFingIn-AggPosOut, the center of the tile is used as the reference position to calculate the positioning error. In this step, the best model weights among the training epochs are selected. A checkpoint function call-back is configured to retain the weights that minimize a cost or loss metric of the model among the training epochs. The metric is evaluated using the validation dataset for fixed tiles FTV. At the end of all of the training epochs, the weights that produced the minimum metric value, among the training epochs, are retrieved and returned as the solution for the model. This process is indicated by the label _Mechanism 2_. In step 2, the position estimates for all of the datasets are calculated. The position estimates of the dataset of moving tiles for validation, MTV, are of importance in step 3 to determining the best solution among different initial weights. The position estimates of the moving tile dataset for testing, MTT, actually should be calculated after the final weights of the model are selected. However, for convenience, the position estimates of the MTT dataset are calculated at this step and stored as a temporary result. Once the final weights of the model are selected, the corresponding temporary results are returned as the final and best result of the model. The first three pattern-matching methods are based on regression. These return a normalized position estimate for each input set or vector of fingerprints. In the case of the method 2-SingFingIn-AggPosOut, the output position estimates are aggregated (as discussed in Section 4.4.2) to produce a final position estimate. Then, in the first three pattern-matching methods, the output position estimate for each input set or vector of fingerprints is unnormalized. The fourth method, 4-MultFingIn-ClassOut, returns a vector of \(N_{T}\) tile-class probabilities. In this case, the position is estimated as explained in Section 4.4.4, that is, calculated from the output tile-class probabilities and the mapping between the tile-classes and the center coordinates of the tiles. It is noted that the model was trained for fixed tiles. Then, when it is used with the moving tiles of the MTV and MTT datasets, this can be interpreted as a transfer learning approach. However, the final selection of the model is biased by the action performed in step 3, selecting the best model among the different initial weights by evaluating the error distance in the moving tiles for the validation, MTV, dataset. In step 4, the error distances are calculated for the MTV and MTT datasets, using unnormalized positions, with Equation (1). Here, Equation (1) takes as input the estimated position coordinates and the known ground truth reference position coordinates. In the methods 1-SingFingIn-PosOut and 3-MultFingIn-PosOut, the ground truth reference position coordinates are taken from the position of the tile which was defined as the center position of the central sub-tile (as discussed in Section 4.4.1).