%% Create and Connect Concatenation Layer
% Create a concatenation layer that concatenates two inputs along the fourth dimension (channels). Name the concatenation layer 'concat'.

concat = concatenationLayer(4,2,'Name','concat')

% Create two ReLU layers and connect them to the concatenation layer. The concatenation layer concatenates the outputs from the ReLU layers.

relu_1 = reluLayer('Name','relu_1');
relu_2 = reluLayer('Name','relu_2');

lgraph = layerGraph();
lgraph = addLayers(lgraph, relu_1);
lgraph = addLayers(lgraph, relu_2);
lgraph = addLayers(lgraph, concat);

lgraph = connectLayers(lgraph, 'relu_1', 'concat/in1');
lgraph = connectLayers(lgraph, 'relu_2', 'concat/in2');
plot(lgraph)

% Copyright 2018 The MathWorks, Inc.