%% Remove Layer from Layer Graph
% Create a layer graph from an array of layers.

layers = [
    imageInputLayer([28 28 1],'Name','input')  
    convolution2dLayer(3,16,'Padding','same','Name','conv_1')
    batchNormalizationLayer('Name','BN_1')
    reluLayer('Name','relu_1')];

lgraph = layerGraph(layers);
figure
plot(lgraph)

%
% Remove the 'BN_1' layer and its connections.

lgraph = removeLayers(lgraph,'BN_1');
figure
plot(lgraph)

% Copyright 2012 The MathWorks, Inc.