Session Ready
Exercise

Defining the model and loss function

In this exercise, you will train a neural network to predict whether a credit card holder will default. The features and targets you will use to train your network are available in the Python shell as borrower_features and default. You defined the weights and biases in the previous exercise.

Note that the predictions layer is defined as \(\sigma(layer1*w2+b2)\), where \(\sigma\) is the sigmoid activation, layer1 is a tensor of nodes for the first hidden dense layer, w2 is a tensor of weights, and b2 is the bias tensor.

The trainable variables are w1, b1, w2, and b2. Additionally, the following operations have been imported for you: keras.activations.relu() and keras.layers.Dropout().

Instructions
100 XP
  • Apply a rectified linear unit activation function to the first layer.
  • Apply 25% dropout to layer1.
  • Pass the target, targets, and the predicted values, predictions, to the cross entropy loss function.