# how to apply MC dropout to an LSTM network keras

I have a simple LSTM network developped using keras:

model = Sequential()


I would like to apply the MC dropout method. How can I enable dropout in the test phase in order to compute the uncertainty?

Thanks.

• Welcome! What do you mean by MC? Please consider dropout is used while training not testing. – Media Mar 26 '19 at 14:29
• i mean montecarlo dropout ,which is a bayesien neural network approach for computing the uncertainty in deep learning – khaoula Mar 26 '19 at 14:38
• Did you manage to use all the dropout options for inference? – Douglas Zechin May 5 at 2:11

keras.layers.Dropout(0.5)(x, training=True)