WXJ96163
WXJ96163

Reputation: 53

There are 5 layers in total, 4 hidden layers and 1 output layers. Is my understanding right?

I am aware of the neural network conceptually. That is, N layer neural networks usually have N-1 hidden layers and 1 output layers.

Could someone help me understand it practically? For instance, how many layers does this code create?

model = Sequential()

model.add(Dense(50, activation='relu'))
model.add(Dense(100, activation='relu'))
model.add(Dense(50, activation='relu'))
model.add(Dense(1))

I guess that the first call creates two layers, and other calls add one layer each. So, there are 5 layers in total, 4 hidden layers and 1 output layers.

Is my understanding right?

Upvotes: 0

Views: 349

Answers (1)

griggy
griggy

Reputation: 446

As it is written, you will have your input layer, that feeds into Dense(50), then you are creating 3 fully connected hidden layers Dense(50), Dense(100), Dense(50) and lastly you have your output layer Dense(1)

Upvotes: 1

Related Questions