global validate and train