Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does Dense do?

What is the meaning of the two Dense in this code?

self.model.add(Flatten())
self.model.add(Dense(512))
self.model.add(Activation('relu'))
self.model.add(Dropout(0.5))
self.model.add(Dense(10))
self.model.add(Activation('softmax'))
self.model.summary()
like image 684
K.SUP Avatar asked May 03 '17 08:05

K.SUP


Video Answer


1 Answers

Dense is the only actual network layer in that model.

A Dense layer feeds all outputs from the previous layer to all its neurons, each neuron providing one output to the next layer.

It's the most basic layer in neural networks.

A Dense(10) has ten neurons. A Dense(512) has 512 neurons.

like image 66
Daniel Möller Avatar answered Sep 21 '22 23:09

Daniel Möller