Consider the following code:

from keras.layers import LSTM
from keras.layers import Dropout
regressor.add(LSTM(units = 20, return_sequences = True))

An LSTM layer consists of LSTM cells ( 20 cells in the above code ) and one cell consists of traditional NN operations ( for example point-wise multiplication and tanh activation function) and gates. One way to view the gates is to see them as neurons. I am aware that there are dropouts within the LSTM layer through the arguments dropout and recurrent_dropout. So I am confused, what is the difference between dropout done by the arguments dropout and recurrent_dropout of LSTM layer and the dropout done by the dropout layer, as above Dropout(0.4) ?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.