Question 1 of Practice quiz: TensorFlow implementation


In the Lecture Neural networks intuition, video Demand Prediction, it says that the input is also counted as an input layer, so I think that there must be 4 hidden layers + 1 input layer = 5 layers in total.

Hi @francesco4203
Welcome to the community!

The input layer isn’t counted in the number of layers because input layer has nothing to do with the actual network. It just directly accepts an input.just called it as input layer to distinguish it from the rest of the layers

Happy Ramandan :blush:
Best Regards,
Abdelrahman

1 Like

Yes, input is not counted as a layer. However, output is counted as a layer, so, in the above image, we have three hidden layers and one output layer, total four.

Best,
Saif.

1 Like

LOL, but I am still confused. Then why is it known as layer 0? It should have no name as a layer to avoid confusion.

Where did you see this? In Python, indices is started from 0, so, layer 0 is the first hidden layer, not the input layer.

I couldn’t get your question

I counted this layer and answered the MCQ:5. But correct ans:4 and layer 0 isn’t counted in the sum of the total layer.

just like he did

This is the answer :slight_smile: Thanks Abdel

Hello @farhana_hossain,

Yes, for the sake of these courses, the simple rule is only the hidden layers and the output layer are counted.

Many things can carry the term “layer” in their names, say, in the Tensorflow framework. For example, besides the input layer, sometimes, people regard activation as a layer so that instead of one “ReLU Dense layer”, we have a “Dense layer without activation” followed by a “ReLU activation” layer.

Should we, then, change how we count the number of layers, knowing that they are equivalent? I think we shouldn’t, and if we keep that simple rule in mind, we wouldn’t.

Cheers,
Raymond

1 Like