https://medium.com/@monocosmo77/working-with-bayesian-inverse-problems-part6-machine-learning-1243c27f66ca