%% Plot Layer Graph
% Create a layer graph from an array of layers. Connect the 'relu_1' layer to the 'add' layer.

layers = [
    imageInputLayer([32 32 3],'Name','input')   
    convolution2dLayer(3,16,'Padding','same','Name','conv_1')
    batchNormalizationLayer('Name','BN_1')
    reluLayer('Name','relu_1')
    
    convolution2dLayer(3,16,'Padding','same','Stride',2,'Name','conv_2')
    batchNormalizationLayer('Name','BN_2')
    reluLayer('Name','relu_2') 
    additionLayer(2,'Name','add')];

lgraph = layerGraph(layers);
lgraph = connectLayers(lgraph,'relu_1','add/in2');

%
% Plot the layer graph.

figure
plot(lgraph);

% Copyright 2018 The MathWorks, Inc.