validation_split
says: "hey give me all the input data – I will take care of splitting between test and validation".
model.fit(inputX, inputY, validation_split=0.20, epochs=10, batch_size=10)
validation_data
says "please give me explicitly the validation data"
model.fit(inputX, inputY, validation_data=(testX,testY), epochs=10, batch_size=10)
Is there any hidden trick or something I am missing apart from my understanding?
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.
validation_split is a parameter that gets passed in. It's a number that determines how your data should be partitioned into training and validation sets. For example if validation_split = 0.1 then 10% of your data will be used in the validation set and 90% of your data will be used in the test set.
Keras can separate a portion of your training data into a validation dataset and evaluate the performance of your model on that validation dataset in each epoch. You can do this by setting the validation_split argument on the fit() function to a percentage of the size of your training dataset.
No, everything is correct. One potential reason behind this separation is that sometimes people have training and validation data separately (in many academic datasets) and sometimes you have all the data and can split it anyway you want.
Your understanding is correct. To add more details - validation_split keras function makes easy for the user to split the training dataset into train and validation (saving your custom efforts).
For example - setting validation_split=0.2, tells keras to use last 20% of the data before shuffling for validation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With