News for hackers. Stuff that matters.
Re:Bayesian statistics and machine learning: How do they dif... by noirdujour on Sunday January 15, 2023 @08:44AM (#34389314)
This touches a little on philosophical difference, but I have found that one major difference is the quantification of uncertainty. Bayesian models, being based naturally around modeling a probability distribution, easily enables the researcher to make claims such as "I am 95% certain the mean lies between x and y, given the data." On the other hand, neural networks, decision trees, and other models more associated with ML than Bayesian statistics do not have this capability built in. (Though there are variations and techniques to build confidence intervals and such with them.)
Re:Bayesian statistics and machine learning: How do they dif... by lalaland1125 on Sunday January 15, 2023 @10:11AM (#34389958)
This isn't true. When you fit a neural network, you are almost always fitting a probability distribution (Bernoulli for binary outcomes, normal for numeric, etc, etc) which can all provide your probability estimates.

When a model for a binary outcomes returns 0.9 for a given data point, that implies a 90% probably that the value is true.

Evaluating the quality of this estimates (often called measuring the calibration of the model) is even very common.

(There are some exception of course. Max margin models aren't probabilistic. And sometimes people use fixed variance parameters for their normal models, etc).

Re:Bayesian statistics and machine learning: How do they dif... by steppi on Sunday January 15, 2023 @10:27AM (#34390057)
This isn’t what your parent is saying. Many machine learning models are capable of producing calibrated probabilities. What Bayesian models give on top of this is that one doesn’t just predict a probability p, but a posterior distribution for p. This allows for estimating confidence bands around p that quantify ones uncertainty in the estimate. This is useful for assessing data drift and detecting anomalous examples. One can also get such uncertainty bands from non-Bayesian methods by considering ensembles of models. See the review paper by Abdar et al. [0] for more info.

[0] https://www.sciencedirect.com/science/article/pii/S156625352...

Re:Bayesian statistics and machine learning: How do they dif... by lalaland1125 on Sunday January 15, 2023 @10:38AM (#34390144)
A "posterior probability for p" for a Bernoulli distribution is meaningless because it's equivalent to a single Bernoulli distribution.
Re:Bayesian statistics and machine learning: How do they dif... by steppi on Sunday January 15, 2023 @10:42AM (#34390175)
If one only had such an estimate for a single example, this would be true, but in aggregate over many predictions, the uncertainty bands can useful for decision making. This is an active area of research.
Re:Bayesian statistics and machine learning: How do they dif... by contravariant on Sunday January 15, 2023 @10:55AM (#34390285)
It's meaningful in the sense that what the model produces is often not the posterior probability.

See my other comment for more detail.

Re:Bayesian statistics and machine learning: How do they dif... by contravariant on Sunday January 15, 2023 @10:54AM (#34390273)
Sure, but you do need to take into account that often fitting a neural network consists of finding the maximum likelihood estimate. So from a Bayesian perspective you're ignoring the prior and you risk overfitting by not considering anything but the most likely alternative. Most attempts to avoid overfitting do not really translate well to the Bayesian perspective.

You can actually recover from this a bit. I saw a paper once where they used the Hessian to approximate the posterior as a gaussian distribution around the maximum likelihood. Can't remember what this paper was called unfortunately.

Re:Bayesian statistics and machine learning: How do they dif... by cjbgkagh on Sunday January 15, 2023 @10:57AM (#34390306)
Depends on the loss function. Softmax final activation into cross entropy loss (or KL divergence) gives probability like predictions. This is a very common set up but there are many others that don’t have this property. I figure that’s what you mean by ‘almost always’. You can also use variational inference where you predict a distribution (usually Gaussian so a sigmoid activation with two values per prediction) and use a Wasserstein loss function and this can be used to get confidence intervals among other things.
Re:Bayesian statistics and machine learning: How do they dif... by datastoat on Sunday January 15, 2023 @11:02AM (#34390342)
Probability estimates are not the same thing as uncertainty.

Consider tossing a coin. If I see 2 heads and 2 tails, I might report "the probability of heads is 50%". If you see 2000 heads and 2000 tails you'd also report the SAME probability estimate -- but you'd be more certain than me.

Neural networks give probability estimates. Bayesian methods (and also frequentist methods) give us probability estimates AND uncertainty.

The literature on neural network calibration seems to me to have missed this distinction.

Re:Bayesian statistics and machine learning: How do they dif... by dwiel on Sunday January 15, 2023 @11:11AM (#34390432)
It is common for a network to output the distribution, so the output is both the mean and variance instead of just the mean like you pointed out. For example check out variational autoencoders.
Re:Bayesian statistics and machine learning: How do they dif... by steppi on Sunday January 15, 2023 @11:16AM (#34390476)
The variational autoencoder is a Bayesian model. See [0] for instance.

[0] https://jeffreyling.github.io/2018/01/09/vaes-are-bayesian.h...

Re:Bayesian statistics and machine learning: How do they dif... by dwiel on Sunday January 15, 2023 @11:30AM (#34390609)
Right, the claim was that "Neural networks give probability estimates. Bayesian methods give us probability estimates AND uncertainty" which presents a false dichotomy. I think we agree.
Re:Bayesian statistics and machine learning: How do they dif... by steppi on Sunday January 15, 2023 @11:42AM (#34390715)
Ah yes, got you. It is a false dichotomy because it neglects that there’s such a thing as Bayesian neural networks. Also, taking ensembles of ordinary neural networks with random initializations approximates Bayesian inference in a sense and this is relatively well known I think.
Re:Bayesian statistics and machine learning: How do they dif... by dwiel on Sunday January 15, 2023 @12:41PM (#34391248)
Yeah right, in my experience I haven't needed as many networks in the ensemble as I first assumed. This paper [1] suggests 5-10, but in practice I've found only 3 has often been sufficient.

[1] https://arxiv.org/abs/1811.12188

Re:Bayesian statistics and machine learning: How do they dif... by steppi on Sunday January 15, 2023 @01:06PM (#34391460)
Very cool. I’ve never tried fewer than 5. Will definitely keep that in mind. Yes, I know that paper.
Re:Bayesian statistics and machine learning: How do they dif... by datastoat on Sunday January 15, 2023 @04:05PM (#34393384)
Indeed, there are Bayesian neural networks and there are non-Bayesian neural networks, and I shouldn't have implied that all neural networks are non-Bayesian.

I'm just trying to point out that there is a dichotomy between the Bayesian and the non-Bayesian, and that the standard neural network models are non-Bayesian, and that we need Bayesianism (or something like it) to talk about (epistemic) uncertainty.

Standard neural networks are non-Bayesian, because they do not treat the neural network parameters as random variables. This includes most of the examples that have been mentioned in this thread: classifiers (which output a probability distribution over labels), networks that estimate mean and variance, and VAEs (which use Bayes's rule for the latent variable but not for the model parameters). These networks all deal with probability distributions, but that's not enough for us to call them Bayesian.

Bayesian neural networks are easy, in principle -- if we treat the edge weights of a neural network as having a distribution, then the entire neural network is Bayesian. And as you say these can be approximated, e.g. by using dropout at inference time [0], or by careful use of ensemble methods [1].

[0] https://arxiv.org/abs/1506.02142

Quote: "Deep learning tools have gained tremendous attention in applied machine learning. However such tools for regression and classification do not capture model uncertainty."

[1] https://arxiv.org/abs/1810.05546

Quote: "Ensembling NNs provides an easily implementable, scalable method for uncertainty quantification, however, it has been criticised for not being Bayesian."

Re:Bayesian statistics and machine learning: How do they dif... by datastoat on Sunday January 15, 2023 @12:42PM (#34391253)
In my example, of predicting a coin toss, the naive output is a probability distribution: it's "Prob(heads)=0.5, Prob(tails)=0.5". This is the distribution that will be produced both by the person who sees 2 heads and 2 tails, and by the person who sees 2000 heads and 2000 tails.

Bayesians use the terms 'aleatoric' and 'epistemic' uncertainty. Aleatoric uncertainty is the part of uncertainty that says "I don't know the outcome, and I wouldn't know it even if I knew the exact model parameters", and epistemic uncertainty says "I don't even know the model".

Your example (outputting a mean and variance) is reporting a probability distribution, and it captures aleatoric uncertainty. When Bayesians talk about uncertainty or confidence, they're referring to model uncertainty -- how confident are you about the mean and the variance that you're reporting?

Re:Bayesian statistics and machine learning: How do they dif... by sdl on Sunday January 15, 2023 @02:26PM (#34392317)
See e.g. Ian Osband's work (he calls it 'risk' VS 'uncertainty' for some good examples that help in differentiating this: https://scholar.google.com/citations?view_op=view_citation&h...
Re:Bayesian statistics and machine learning: How do they dif... by mr_toad on Sunday January 15, 2023 @07:14PM (#34395156)
> The literature on neural network calibration seems to me to have missed this distinction.

I’d hazard a guess that analytical solutions are intractable and numerical solutions would be infeasible.

Re:Bayesian statistics and machine learning: How do they dif... by PartiallyTyped on Sunday January 15, 2023 @11:43AM (#34390719)
Neural networks are notorious for being overconfident and their predictions shouldn’t be taken at face value ie as probabilities.