Refactored train_utils.py

1 job for master in 27 minutes and 50 seconds (queued for 1 second)