Skip to main content
. 2026 Oct 28;18(21):2678. doi: 10.3390/polym18212678
Algorithm 1: GJO-Based Hyperparameter Optimization of PI-RNN
Input:
    Training dataset Dtrain
    Validation dataset Dval
    Search space H
    Population size P
    Maximum iterations T
Output:
    Optimal hyperparameter set H*
Initialize P Golden Jackal positions within search space H
Evaluate the fitness of each jackal using validation loss
for t = 1 to T do
  Identify the best jackal position Hbest
  Identify the second-best jackal position Hsecond
for i = 1 to P do
Update the position of jackal i
Keep updated parameters within their predefined bounds
Construct the PI-RNN using the updated parameters
Train the PI-RNN using Dtrain
Calculate data, physics, and constraint losses
Evaluate the combined fitness using Dval
end for
Update Hbest according to the minimum fitness value
 end for
Return H* = Hbest