Using neural networks to learn energy corrections in hadronic calorimeters