getting started with neural networks y_val y_train[: partial_y_train y_train[ :you'll now train the model for epochs ( iterations over all samples in the x_train and y_train tensors)in mini-batches of samples at the same timeyou'll monitor loss and accuracy on the , samples that you set apart you do so by passing the validation data as the validation_data argument listing training your model model compile(optimizer='rmsprop'loss='binary_crossentropy'metrics=['acc']history model fit(partial_x_trainpartial_y_trainepochs= batch_size= validation_data=(x_valy_val)on cputhis will take less than seconds per epoch--training is over in seconds at the end of every epochthere is slight pause as the model computes its loss and accuracy on the , samples of the validation data note that the call to model fit(returns history object this object has member historywhich is dictionary containing data about everything that happened during training let' look at ithistory_dict history history history_dict keys([ 'acc' 'loss' 'val_acc' 'val_loss'the dictionary contains four entriesone per metric that was being monitored during training and during validation in the following two listinglet' use matplotlib to plot the training and validation loss side by side (see figure )as well as the training and validation accuracy (see figure note that your own results may vary slightly due to different random initialization of your network listing plot ing he training and validat ion loss import matplotlib pyplot as plt history_dict history history loss_values history_dict['loss'val_loss_values history_dict['val_loss'epochs range( len(acc bois for blue dot plt plot(epochsloss_values'bo'label='training loss'plt plot(epochsval_loss_values' 'label='validation loss'plt title('training and validation loss'bis for solid plt xlabel('epochs'blue line plt ylabel('loss'plt legend(plt show(licensed to