Building the neural network

For building DNNs, we use the fully_connected function for the first hidden layer. The input for this hidden layer is x, which is the data from the placeholder. n_hidden1 is the number of neurons that we have in this hidden layer, which you will remember is 350 neurons. Now, this hidden layer 1 becomes the input for the hidden layer 2, and n_hidden2 is the number of neurons in this layer. Likewise, hidden layer 2 becomes the input for the third hidden layer and we will use this number of neurons in this layer. Finally, the output layer, which we will call logits, is the fully connected layer that we use as input, hidden layer 3. The following screenshot shows the lines of code used for building the neural network:

We enter the output as 10 because we have 10 categories in our classification problem and we know that in the output layer we don't use any activation function.