I am new to Python programming. I wrote a python script for LSTM for modelling sequence data by using Keras. Overall, there are two options now that I need to manually adjust for each run, which are learning rate and model.
I want to test four different learning rates (i.e., 1e-2, 1e-3, 1e-4 and 1e-5) and four different models (i.e., model1, mode2, model3 and model4). It should be noted that these models are those provided by Keras, e.g., LSTM, SimpleRNN or GRU. I use model1, model2..., just for illustration.
At the moment, my code is structured as follows:
#pseudo-codes
learningRate = 1e-2 #tunable parameter
model = Sequential()
model.add(model1(hidden_uints)) #other inputs within the model is omitted
#model1 is to be changed to model2, model3 and model4 later
model.complie(optimizer = sgd(lr = learningRate))
model.fit(xtrain,ytrain)
Every time the training is done, I will adjust the learning rate and model3 for another run. I feel there should be a more appropriate code structure to implement these options (4*4 = 16 runs) all at once.