I am able to train the following model and now I want to do some transfer learning to some other data. The new data has 8 features. Below is the model.
LSTMModel(
(lstm): LSTM(5000, 128, num_layers=2, batch_first=True)
(fc): Linear(in_features=128, out_features=2, bias=True)
)
I’m trying to take inspiration from the here but that’s a CNN and I can’t find anything similar for a LSTM. Below is what I’ve tried with no luck. The new model will also perform binary classification.
first_lstm_layer = [nn.LSTM(8, hidden_dim, layer_dim, batch_first=True)]
first_lstm_layer.extend(list(model))
newModel = nn.LSTM(*first_lstm_layer)