Refactored the training to return an informative state rather than a
Boolean flag.