Added ability to train maximum entropy models