%% Create and Connect Addition Layer
% Create an addition layer with two inputs and the name 'add_1'.
%

add = additionLayer(2,'Name','add_1')

%
% Create two ReLU layers and connect them to the addition layer. The addition layer sums 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,add);

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

plot(lgraph)

% Copyright 2012 The MathWorks, Inc.