Restructured the training method, added likelihood and max-steps stopping
criteria.