title: What is validation data used for in a Keras Sequential model?
body: <p>My question is simple, <strong>what is the validation data</strong> passed to model.fit in a Sequential model <strong>used for</strong>?</p>
  
  <p>And, does it affect how the model is trained (normally a validation set is used, for example, to choose hyper-parameters in a model, but I think this does not happen here)?</p>
  
  <p>I am talking about the validation set that can be passed like this:</p>
  
  <pre><code># Create model
  model = Sequential()
  # Add layers
  model.add(...)
  
  # Train model (use 10% of training set as validation set)
  history = model.fit(X_train, Y_train, validation_split=0.1)
  
  # Train model (use validation data as validation set)
  history = model.fit(X_train, Y_train, validation_data=(X_test, Y_test))
  </code></pre>
  
  <p>I investigated a bit, and I saw that <code>keras.models.Sequential.fit</code> calls <code>keras.models.training.fit</code>, which creates variables like <code>val_acc</code>and <code>val_loss</code> (which can be accessed from Callbacks). <code>keras.models.training.fit</code> also calls <code>keras.models.training._fit_loop</code>, which adds the validation data to the <code>callbacks.validation_data</code>, and also calls <code>keras.models.training._test_loop</code>, which will loop the validation data in batches on the <code>self.test_function</code> of the model. The result of this function is used to fill the values of the logs, which are the values accessible from the callbacks.</p>
  
  <p>After seeing all this, I feel that the validation set passed to <code>model.fit</code> is not used to validate anything during training, and its only use is to get feedback on how the trained model will perform in every epoch for a completely independent set. Therefore, it would be okey to use the same validation and test set, right?</p>
  
  <p>Could anyone confirm if the validation set in model.fit has any other goal besides being read from the callbacks?</p>