Clear Filters
Clear Filters

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

4 views (last 30 days)
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.

Accepted Answer

Richard
Richard on 4 May 2023
"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')]

More Answers (0)

Categories

Find more on Install Products in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!