Variational Learning For Inverse Problems