%% Check Validity of Layer with Multiple Inputs
% Check the layer validity of the custom layer weightedAdditionLayer.
% Define a custom weighted addition layer. To create this layer, save the file weightedAdditionLayer.m in the current folder.
% Create an instance of the layer and check its validity using checkLayer. Specify the valid input sizes to be the typical sizes of a single observation for each 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 'ObservationDimension' to 4.

layer = weightedAdditionLayer(2,'add');
validInputSize = {[24 24 20],[24 24 20]};
checkLayer(layer,validInputSize,'ObservationDimension',4)

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