CommencerCommencer gratuitement

Is the model overfitting?

Let's train the model you just built and plot its learning curve to check out if it's overfitting! You can make use of the loaded function plot_loss() to plot training loss against validation loss, you can get both from the history callback.

If you want to inspect the plot_loss() function code, paste this in the console: show_code(plot_loss)

Cet exercice fait partie du cours

Introduction to Deep Learning with Keras

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Train your model for 60 epochs, using X_test and y_test as validation data
h_callback = model.fit(____, ____, epochs = ____, ____ = (____, ____), verbose=0)

# Extract from the h_callback object loss and val_loss to plot the learning curve
plot_loss(____.____[____], ____.____[____])
Modifier et exécuter le code