Effacer les filtres
Effacer les filtres

How to add a dense layer to a neural network?

26 vues (au cours des 30 derniers jours)
LinkTo
LinkTo le 2 Sep 2022
Hello,
I am trying to build a neural network but I can't figure out how to add a dense layer in MATLAB.
The python equivalent of the code that I want to implement in MATLAB is the following:
model.add(Dense(20, activation='relu',
activity_regularizer=tf.keras.regularizers.l1(0.00001)))
Any help is appreciated. Thanks.

Réponse acceptée

Sivylla Paraskevopoulou
Sivylla Paraskevopoulou le 6 Sep 2022
I think you want to use a fullyConnectedLayer. You can set the properties of the fullyconnectedLayer object. I also think you will find useful the examples in the fullyConnectedLayer documentation page and this example: Create Simple Image Classification Network.

Plus de réponses (0)

Catégories

En savoir plus sur Image Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by