Code for running single version training.