# Predictions callbacks


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## MCDropoutCallback

> Turns on dropout during inference, allowing you to call
> Learner.get_preds multiple times to approximate your model uncertainty
> using [Monte Carlo Dropout](https://arxiv.org/pdf/1506.02142.pdf).

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/callback/preds.py#L12"
target="_blank" style="float:right; font-size:smaller">source</a>

### MCDropoutCallback

``` python

def MCDropoutCallback(
    after_create:NoneType=None, before_fit:NoneType=None, before_epoch:NoneType=None, before_train:NoneType=None,
    before_batch:NoneType=None, after_pred:NoneType=None, after_loss:NoneType=None, before_backward:NoneType=None,
    after_cancel_backward:NoneType=None, after_backward:NoneType=None, before_step:NoneType=None,
    after_cancel_step:NoneType=None, after_step:NoneType=None, after_cancel_batch:NoneType=None,
    after_batch:NoneType=None, after_cancel_train:NoneType=None, after_train:NoneType=None,
    before_validate:NoneType=None, after_cancel_validate:NoneType=None, after_validate:NoneType=None,
    after_cancel_epoch:NoneType=None, after_epoch:NoneType=None, after_cancel_fit:NoneType=None,
    after_fit:NoneType=None
):

```

*Basic class handling tweaks of the training loop by changing a
[`Learner`](https://docs.fast.ai/learner.html#learner) in various
events*

``` python
learn = synth_learner()

# Call get_preds 10 times, then stack the predictions, yielding a tensor with shape [# of samples, batch_size, ...]
dist_preds = []
for i in range(10):
    preds, targs = learn.get_preds(cbs=[MCDropoutCallback()])
    dist_preds += [preds]

torch.stack(dist_preds).shape
```

    torch.Size([10, 32, 1])
