On the use of neural networks for energy reconstruction in high-granularity calorimeters