Variational Methods for Machine Learning with Applications to Deep Networks