Combined CNN and LSTM

New to Pytorch and CNN

What is the best way to combine a CNN with a LSTM model?

Should I define the CNN class
Define the LSTM class
Then define a model that combines both


Should I wrap them all in one class?

Thanks in advance for response.


I would argue the implementation depends on your coding style and how you would like to use the model.
E.g. if you want to call the submodules separately in the future or would like to easily inspect the output of the first module, you could use the split approach.
However, usually you would implement the model as once class.

Many thanks for replying Greatly appreciated.

Do you have any suggestions about where I could find good examples of combined Models…or a good site/book to read on the subject matter f combination models.

So far I’m using pytorch site, deeplizard, towards datascience and blog posts.

Many thanks


We have a couple of forum posts about ConvLSTM, so these posts might have a good starter code.

Thanks again…it’s kind of you to help others starting out. Greatly appreciated.

1 Like