An approach to non-equilibrium statistical physics using variational Bayesian inference