MATLAB Answers

L1 and L2 Regularization for matlab

55 ビュー (過去 30 日間)
Abdussalam Elhanashi
Abdussalam Elhanashi 2019 年 10 月 17 日
Answered: Divya Gaddipati 2019 年 10 月 21 日
Hi Guys
I would like to know how to add regularization L1 & L2 for following layers to reduce overfitting
imageInputLayer([32 32 3],"Name","imageinput")
convolution2dLayer([5 5],32,"Name","conv","BiasLearnRateFactor",2,"Padding",[2 2 2 2],"WeightsInitializer","narrow-normal")
batchNormalizationLayer
maxPooling2dLayer([3 3],"Name","maxpool","Stride",[2 2])
preluLayer(20,'prelu')
averagePooling2dLayer([3 3],"Name","avgpool","Stride",[2 2])
fullyConnectedLayer(2,"Name","fc_rcnn","BiasL2Factor",1,"BiasLearnRateFactor",10,"WeightLearnRateFactor",20,"WeightsInitializer","narrow-normal")
dropoutLayer(0.65,'Name','drop1')
softmaxLayer("Name","softmax")
classificationLayer("Name","classoutput")];

  0 件のコメント

サインイン to comment.

件の回答 (1)

Divya Gaddipati
Divya Gaddipati 2019 年 10 月 21 日
You can set the L2 regularization for selected layers using the setl2factor function.
You can refer to the following link for more understanding:

  0 件のコメント

サインイン to comment.

サインイン してこの質問に回答します。


Translated by