To get more accurate results which one is better? Adding more layers or increasing number of epochs? I like to know the difference between effects of these two approaches?


Increasing the number of epochs :

This is the best when you have a large and diverse dataset. A large dataset refers to a number of diverse samples in equal amounts ( no bias ). Also, you make your model generalise better, you might increase the dropout rates and decrease the learning rate. At such a time increasing the number of epochs would help the model generalise better. Also, since it has generalised on a diversed dataset means it can perform well in the real world. For LSTMs, they can make correct predictions based on the sequences.

Increasing the number of layers of LSTM :

If we treat each LSTM as a memory unit then we are increasing the number of memory units and thus the overall memory. The first sequences would be feed to the next layer hence a model could create a hierarchical representation of the data. This is better if you have sequences which have such a context like an image.

On considering both the scenarios, if you have abundant data then the first option is optimum. If you have complex data which has less diversity then the second and the first points need to be considered.

  • $\begingroup$ How can I play with learning rate in Keras.LSTM? $\endgroup$ – user145959 Feb 28 at 11:11
  • $\begingroup$ I referred the learning rate which is initialized with the optimizer in the fit() method of your model. If you are using an RMSprop optimizer for your model then model.fit( optimizer=keras.optimizers.RMSprop( lr=0.0001 ) , loss='categorical_crossentropy' ) where lr= is the learning rate. $\endgroup$ – Shubham Panchal Feb 28 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.