%% Check Validity of Custom Layer Using checkLayer
% Check the layer validity of the custom layer preluLayer.
% The custom layer preluLayer, attached to this is example as a supporting file, applies the PReLU operation to the input data. To access this layer, open this example as a live script.
% Create an instance of the layer and check its validity using checkLayer. Specify the valid input size to be the size of a single observation of typical input to the layer. The layer expects 4-D array inputs, where the first three dimensions correspond to the height, width, and number of channels of the previous layer output, and the fourth dimension corresponds to the observations.
% Specify the typical size of the input of an observation and set the ObservationDimension option to 4.

layer = preluLayer(20);
validInputSize = [24 24 20];
checkLayer(layer,validInputSize,ObservationDimension=4)

% Here, the function does not detect any issues with the layer.
% Copyright 2018 The MathWorks, Inc.