splitLayer - Split layer - MATLAB (original) (raw)
Description
Use dlhdl.layer.splitLayer
objects to create a split layer. You can use split layers to divide a layer output into equal parts along the channel dimension of the image.
Creation
Syntax
Description
`layer` = dlhdl.layer.splitLayer(`Name`,[numOutputGroups](#mw%5F870c1b87-0977-464f-abf5-eb9630c4e5d4))
creates a split layer, sets the Name
property, and splits the output of the layer into equal parts specified by the numOutputGroups
argument along the channel dimension of the image.
Input Arguments
Number of groups to split layer output into, specified as a positive integer.
Example: 2
Properties
Layer
Data Types: char
| string
This property is read-only.
Number of inputs to the layer, stored as 1
. This layer accepts a single input only.
Data Types: double
This property is read-only.
Input names, stored as {'in'}
. This layer accepts a single input only.
Data Types: cell
This property is read-only.
Number of outputs from the layer, returned as positive integer. Specify the number of outputs using numOutputGroups
.
This property is read-only.
Output names of the layer, returned as a string array or a cell array of character vectors.
If numOutputGroups
is 1
, then the software sets OutputNames
to {'out'}
. IfnumOutputGroups
is greater than 1
, then the software sets OutputNames
to{'out1',...,'outM'}
, where M
is the number of outputs.
Examples
Create a split layer with the name split
.
s = dlhdl.layer.splitLayer("split",2)
s =
splitLayer with properties:
Name: 'split'
NumOutputs: 2
OutputNames: {'out1' 'out2'}
Learnable Parameters No properties.
State Parameters No properties.
Show all properties
Include the split layer in a Layer
array.
imageSize = [20 20 16]; layers = [ imageInputLayer(imageSize,"Name","imageinput","Normalization","none") convolution2dLayer(3,16,"Padding","same") dlhdl.layer.splitLayer("split",2) maxPooling2dLayer(3,'Padding','same','Name','pool')]
layers =
4×1 Layer array with layers:
1 'imageinput' Image Input 20×20×16 images
2 '' 2-D Convolution 16 3×3 convolutions with stride [1 1] and padding 'same'
3 'split' dnnfpga.layer.splitLayer dnnfpga.layer.splitLayer
4 'pool' 2-D Max Pooling 3×3 max pooling with stride [1 1] and padding 'same'
Version History
Introduced in R2025a