SAM as an Optimal Relaxation of Bayes