use validation data for training