Aan de slagGa gratis aan de slag

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)

Deze oefening maakt deel uit van de cursus

Introduction to Deep Learning with Keras

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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(____.____[____], ____.____[____])
Code bewerken en uitvoeren