No account yet ?
The dense layer is a neural network that has a deep connection, which means that each neuron in the dense layer receives input from all neurons in its previous layer.
The dense layer performs matrix x vector multiplication, and the values used in the matrix are parameters that can be trained and updated using backpropagation.
The output generated by the dense layer is an n-dimensional vector.
The dense layer is used to modify the dimensions, rotation, scaling and translation of the vector.
Advantages and Disadvantages of the Dense Layer:
The Dense Layer offers learning functionality from all the combinatorial functionality of the previous layer, unfortunately the Dense Layer is very computationally expensive. This is why it was sometimes only used to combine the characteristics of the upper layer.
Tested in Anaconda and Python 3.7
from tensorflow import keras model = keras.models.Sequential([ keras.Input(shape = (16, )), keras.layers.Dense(32, activation='relu') ]) model.summary()
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
dense (Dense) (None, 32) 544
=================================================================
Total params: 544
Trainable params: 544
Non-trainable params: 0
_________________________________________________________________
Tested in Anaconda and Python 3.7
from tensorflow import keras model = keras.models.Sequential([ keras.Input(shape = (16, )), keras.layers.Dense(32, activation='relu'), keras.layers.Dense(16, activation = 'relu'), keras.layers.Dense(8, activation = 'relu') ]) model.summary()
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
dense (Dense) (None, 64) 1088
_________________________________________________________________
dense_1 (Dense) (None, 32) 2080
_________________________________________________________________
dense_2 (Dense) (None, 16) 528
_________________________________________________________________
dense_3 (Dense) (None, 8) 136
=================================================================
Total params: 3,832
Trainable params: 3,832
Non-trainable params: 0
_________________________________________________________________
Welcome, my name is Eric Soupet and I am the administrator of the site elodees.com. elodees.com is a state of the art of Artificial Intelligence and aims to be collaborative, you can now offer content such as articles, events, tutorials, ... so don't hesitate !
Platform images credit : Pixabay - Pixabay License | Pexels - Pexels License