0

Let us use a validation split of 0.3 when fitting a Sequential model. What will be used for validation, the first or the last 30% samples?

Secondly, checkpointing the best model saves the best model weights in .hdf5 file format. Does this mean that, for a certain experiment, the saved model is the best tuned model?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Khan
  • 81
  • 2
  • 7

1 Answers1

1

For your first question, the last 30% samples will be used for validation.

From Keras documentation:

validation_split: Float between 0 and 1. Fraction of the training data to be used as validation data. The model will set apart this fraction of the training data, will not train on it, and will evaluate the loss and any model metrics on this data at the end of each epoch. The validation data is selected from the last samples in the x and y data provided, before shuffling

For your second question, I assume that you're talking about ModelCheckpoint with save_best_only=True. In this case, this callback saves the weights of a given epoch only if monitor ('val_loss', by default) is better than the best monitored value. Concretely, this happens here. If monitor is 'val_loss', this should be the tuned model for a particular setting of hyperparameters, according to the validation loss.

rvinas
  • 11,824
  • 36
  • 58