Optionally randomly shuffle the training and validation data