Asis
Asis

Reputation: 303

How many hidden layers and total layers this neural network has?

I build a MLP using keras using below code.

model_relu = Sequential()
model_relu.add(Dense(256, activation='relu', input_shape=(input_dim,), kernel_initializer=RandomNormal(mean=0.0, stddev=0.062, seed=None)))
model_relu.add(Dense(128, activation='relu', kernel_initializer = RandomNormal(mean=0.0, stddev=0.125, seed=None)) )
model_relu.add(Dense(64, activation='relu', kernel_initializer = RandomNormal(mean=0.0, stddev=0.07, seed=None)) ) 
model_relu.add(Dense(output_dim, activation='softmax'))

model_relu.summary()

The summary is

Model: "sequential_19"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
dense_49 (Dense)             (None, 256)               200960    
_________________________________________________________________
dense_50 (Dense)             (None, 128)               32896     
_________________________________________________________________
dense_51 (Dense)             (None, 64)                8256      
_________________________________________________________________
dense_52 (Dense)             (None, 10)                650       

I want to how many hidden layers this MLP has. Should we call 3 as number of hidden layers in this or 4 hidden layers. Is total number of layers is 5 (Input + 3 hidden + 1 output(softmax)?

Upvotes: 0

Views: 264

Answers (1)

Batuhan B
Batuhan B

Reputation: 1855

You have 1 input layer with 256 neurons, 2 hidden layers with 128 and 64 neurons and finally you have 1 output layer with 10 neurons.

Upvotes: 2

Related Questions