I am pretty new to Python and this board so I am not sure, if I am at the right place for my question since it doesn't include any code. If not so, please give my a hint for a better way/place to ask.

I am struggling with using Monte Carlo Dropouts for determine Uncertainty for my image classificator using ResNet18.

I have read several papers to this topic and I am still kinda confused about this topic.

I know already to use dropout like

def dropout2d(input, p=0.5, training=True, inplace=False):

multiply times for getting a variance which can be interpreted as the uncertainty. I am pretty sure, that I already understood how MC-Dropout works in general.

So coming to my questions:

Do I use MC-dropout while training or testing and why? I feel like I have read different ways.

I have searched for a coding example from the dropouts but didn't find anything. Do you know Paper/ example code/ searchlink for a proper code?


nn.dropout2d(imput, p=x, ...) the right way to use dropout for a image classificator?

Thanks for your help.

  • $\begingroup$ Just to say that your question is perfectly fine here, but I don't know the answer sorry $\endgroup$
    – Erwan
    Jun 27, 2019 at 11:23

1 Answer 1


Monte Carlo Dropouts (MCDO) is used during the prediction / inference phase to provide an estimate of uncertainty for the model's predictions.

Regular dropout during the training phase is a regularization technique.

  • $\begingroup$ For the case of regression, would this correspond to confidence intervals around the conditional expectation or characterize the full conditional distribution of the target? $\endgroup$ Jan 4, 2021 at 12:27

Your Answer

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

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