## 5 Implementation and Evaluation
### Experimental Results  
Before implementing and evaluating each RNN model, we employed a grid search approach to determine the optimal set of hyperparameters. This involved systematically exploring various combinations of hyperparameter values, such as hidden size and the number of layers for each RNN architecture--LSTM GRU and LSTM-BIGRU. The goal was to identify the parameter configuration that yielded the highest average accuracy across all models. The grid search allowed us to efficiently navigate the hyperparameter space and discover the most effective model settings for our specific dataset and task. We have used [32; 34] hidden size and [1; 2] number of layers as the search space to find the optimal hyperparameters. The outcomes of the grid search suggested training the RNN models with distinct hyperparameters, such as the hidden size and the number of layers, with the other parameters outlined in Table 5. As shown in Figure 10, we employed a hybrid deep learning model incorporating LSTM and GRU layers for simultaneous activity recognition and localization. The model architecture consists of the following: an input layer with 240 features, a bidirectional LSTM layer to effectively capture temporal dependencies, a bidirectional GRU layer to further enhance the model's ability to learn complex patterns, fully connected layers with ReLU activation, and separate branches for activity and location predictions. We trained the model using the Adam optimizer with a learning rate of 0.0001. The training loop was executed over 60 epochs, with the cross-entropy loss function applied to both the activity and location predictions. At 20 MHz, the LSTM-GRU model demonstrated satisfactory training and test accuracy, indicating its ability to learn and generalize well on the given dataset. However, a notable concern was observed in the learning curve, where the loss function showed signs of divergence. Divergence in the learning curve suggests that the model struggles to converge to an optimal solution during training. This issue is characterized by an increasing trend in the training loss, indicating that the model's parameter updates are not effectively minimizing the loss function. Addressing this challenge may require further hyperparameter tuning, regularization techniques, or adjustments to the network architecture to improve stability and convergence. On the other hand, the LSTM-GRU model at 40 MHz showcased in Figure 11 shows a more favorable learning curve. The loss curve demonstrates a smoother descent, suggesting that the optimization process is more stable and effective. This smoother learning curve implies that the model at 40 MHz is converging efficiently during training, which is crucial for achieving optimal performance. We investigated the LSTM-BIGRU hybrid neural network model for our simultaneous activity prediction and location estimation. It leverages a combination of LSTM and bidirectional GRU layers to capture temporal dependencies in the data. \begin{table}
\begin{tabular}{l c} \hline \hline
**Parameters** & **Value** \\ \hline Hidden size & 64 \\ Number of layers & 1 \\ Learning rate & 0.0001 \\ Optimizer & Adam \\ Batch size & 32 \\ Loss function & Cross-entropy \\ Random state & 42 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Hyperparameters. The LSTM layer extracts sequential features, and its bidirectional nature enhances the model's understanding of both past and future contexts. The subsequent bidirectional GRU layer further refines the temporal representations. The fully connected layers transform the extracted features to predict activities and locations concurrently. The model's architecture enables it to make predictions based on the entire input sequence, with the final output representing the joint predictions for activity and location at the last time step. The ReLU activation function is applied to enhance nonlinearity in the learned features. This  
Figure 11: Learning curve and confusion matrix of the LSTM-GRU at 40 MHz.