## 2 Materials and Methods
### Training Configuration  
Several BiLSTM models with two BiLSTM layers were trained to estimate the FTSW. These models differed from each other in the number of input variables, the model lookbacks (input size), and the length of the output.The length of the output was set to 1, 3, 5, and 7 days for the FTSW forecast, and the number of look-backs was set to 3, 5, and 7 days of the historical data.  
Hyperparameters' Selection  
The hyperparameters are the variables that determine how the network is trained (e.g., learning rate) or the parameters that determine the structure of the model (e.g., the number of hidden layers). The process of determining the best combination of hyperparameters to maximize model performance is known as hyperparameter tuning (or hyperparameter optimization). It has been demonstrated that changing the number of nodes per layer in LSTM models has a more significant effect on the results than altering the number of layers [52]. To predict the simulated soil moisture, the network designs of LSTM and BiLSTM with two, three, and four LSTM layers and one and two BiLSTM layers were investigated in [44]. The BiLSTM model with two layers was utilized for prediction because it achieved the best accuracy in the above-mentioned study.  
The search for the hyperparameters is an optimization problem. The goal is to find the hyperparameters such that they maximize the loss function. There are several methods for solving this problem, such as greedy search [53], random search [54], and Bayesian optimization [55]. In greedy search, a search space must be selected, i.e., a region in which each point represents a different model configuration and each dimension represents a hyperparameter. The algorithm evaluates each position in the grid to find the best hyperparameters. The disadvantage of this method is that the space is discrete and the algorithm's search in each space is time-consuming. To address the time-consuming drawback of greedy search, the random greedy search algorithm randomly selects a value from the search space, but the values are still randomly selected and may result in a hyperparameter that is not the best. Bayesian optimization is used to solve the optimization problem when the objective function is a black box, such as the lossfunction in DL models. Tuning the hyperparameters using Bayesian optimization can reduce the time required to find the best parameter set and improve the generalization performance in the test set. Moreover, the space can be chosen as a continuous space. The other hyperparameters in this study were the number of units in each BiLSTM layer, the learning rate, the learning rate decay, the batch size, and the dropout size. The Bayesian optimization algorithm [55] was used to select these hyperparameters. The set of hyperparameters is shown in Table 3.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **Batch Size** & **Dropout Size** & **Learning Rate** & **Decay** & **No. of Units** \\ \hline FTSW prediction model & 40 & 0.09313 & 0.003968 & 0.003456 & 158 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Hyperparameters selected by the Bayesian optimization algorithm.