Reputation: 31
I am new to deep_learning and working with Keras, so I want to know what is Dense meaning when we have a code like the one below :
I read the https://keras.io/getting-started/sequential-model-guide/ and I also found some explanations like : Dense implements the operation: output = activation(dot(input, kernel) + bias) where activation is the element-wise activation function passed as the activation argument, kernel is a weights matrix created by the layer, and bias is a bias vector created by the layer (only applicable if use_bias is True). which didnt help me so much!
model = Sequential([
Dense(32, input_shape=(784,)),
Activation('relu'),
Dense(10),
Activation('softmax'),
Upvotes: 2
Views: 12028
Reputation: 77
The code you wrote is not for LSTM, this is a simple neural network of two fully connected layers also known as dense layers, here sequential means the output of one layer will be directly passed to next layer, which is not sequential learning like LSTM.
Upvotes: 1
Reputation: 2171
Another name for dense layer is Fully-connected layer. It's actually the layer where each neuron is connected to all of the neurons from the next layer. It implements the operation output = X * W + b
where X
is input to the layer, and W
and b
are weights and bias of the layer. W
ad b
are actually the things you're trying to learn. If you want a more detailed explanation, please refer to this article.
Upvotes: 2
Reputation: 599
A dense layer is a fully-connected layer, i.e. every neurons of the layer N are connected to every neurons of the layer N+1
Upvotes: 1