Code accompanying the paper: Variational Reformulation of Bayesian Inverse Problems, by. Tsilifis P., Bilionis I., Katsounaros I. and Zabaras N.