Add layers to layer graph
newlgraph = addLayers(lgraph,larray)
adds the network layers in
newlgraph = addLayers(
larray to the layer graph
lgraph. The new layer graph,
newlgraph, contains the layers and connections of
lgraph together with the layers in
larray, connected sequentially. The layer names in
larray must be unique, nonempty, and different from the
names of the layers in
Create an empty layer graph and an array of layers. Add the layers to the layer graph and plot the graph.
addLayers connects the layers sequentially.
lgraph = layerGraph; layers = [ imageInputLayer([32 32 3],'Name','input') convolution2dLayer(3,16,'Padding','same','Name','conv_1') batchNormalizationLayer('Name','BN_1') reluLayer('Name','relu_1')]; lgraph = addLayers(lgraph,layers); figure plot(lgraph)