Bayesian Inverse Problems with Connections to Machine Learning