Automatic Curriculum Learning for Neural Networks