Neural network reconstruction of cosmology using the Pantheon compilation