Building the DNN

For building the following example, we first have to define the DNN function. This function will take X_values and output the predictions. For the first hidden layer, we use a fully_ connected function. The input for this hidden layer will be X, which is the data that comes from the placeholder, and n_hidden1 is the number of neurons that we have in this hidden layer. Remember we have 350 neurons in the first hidden layer. Now, the first hidden layer becomes the input for the second hidden layer, and n_hidden2 is the number of neurons that we use in this second hidden layer. Likewise, this second hidden layer becomes the input for the third hidden layer and we use this number of neurons in this layer. Finally, we have the output layer, let's call it y_pred, and this is a fully connected layer, with the third hidden layer as input. This is one output and this layer has no activation function. The following screenshot shows the lines of code used for building the neural network: