ReLu 'Activation function' is not a recognized parameter in convolution2dLayer

3 次查看(过去 30 天)
convolution2dLayer(32, 7, 'Stride', 2, 'Padding', 'same', 'Name', 'conv_1', 'Activation', 'relu')
This is my line code and resulted error below:
Error using convolution2dLayer>iParseInputArguments (line 155)
'ActivationFcn' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for this
function.

采纳的回答

Richard
Richard 2023-5-4
"Activation" is not a valid input option for convolution2dLayer in MATLAB. In MATLAB, activation functions are specified by connecting the output of the convolution layer to an appropriate activation layer - in this case reluLayer:
convRelu = [...
convolution2dLayer(32, 7, 'Stride', 2, 'Padding', 'same', 'Name', 'conv_1'); ...
reluLayer('Name', 'relu_1')]

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Install Products 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by