1
$\begingroup$

Consider the following code:

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

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) ?

$\endgroup$

0

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.