A holistic approach to computing first-arrival traveltimes using neural networks