Implementation of dropout layer

i understand how dropout layers work in theory but i dont get how are they added in keras.
From the videos that I have seen, I understood that dropout is a feature that can be added to a layer.

So when we use model.add(Dropout(0.5)). does that mean that

1). we are adding a new layer having this dropout feature to our model next to the previous lstm layer.

2). we are adding dropout functionality to the previous LSTM layer and keeping the model as same.

My doubt is because there is a dropout layer added between 2 LSMT layers in this video.

Hey @adityapatidar3496, dropout layer is used to drop some of the weights learned by our network. So it works on the previous layer of your network. So yeah (1) option is correct for your doubt !

Dropout layers are just used for generalisation …so that your model can perform well on unseen data :+1:

I hope this helps !
Happy Learning ! :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.