is it possible to use a bayesian neural network to calculate the covariance matrix among a set of predicted values? as title says, i have created a little bayesian fcnn with dropout layers trained on some cosmological data that come with a covariance matrix that is  almost 0 everywhere. My goal was to use the NN to predict some  continuous values in a range where data are scarce (it's a regression case), but i also need the covariance matrix among the predicted values. I was wondering if there was a way to calculate it. wikipedia https://en.wikipedia.org/wiki/Estimation_of_covariance_matrices gives a formula for the estimate of covariance but i don't know if it's valid for the result predicted by a neural network , especially one with dropout layers turned on. thanks

Yes, but how difficult it is depends on how your neural network is Bayesian. For example this is really easy in the way it was done for the BatchBALD paper. There it was done via the use of drop-out at inference time and the key thing was just to use the same dropout mask for all records for each Monte-Carlo sample. I.e. do inference repeatedly for all records, say, 1000 times and for each of the 1000 runs you use the same dropout mask for all examples. In practice, you do may end up doing that by setting the random number seed each time before running inference.
