Learning simulations directly with online posterior estimation