In short, the rough idea of Bayesian neural networks is to treat the output as observations from distributions. By providing data of the expected output, we can adjust and update our distributions accordingly. For this binary classification example, we’re modeling the class label as a draw from a Bernoulli distribution with probability preds[i], hence “observing” each prediction.