Added stop criterion API to training
Fixed docs