SKYNET: an efficient and robust neural network training tool for machine learning in astronomy