groupLayers
Syntax
Description
groupLayers
groups layers in a network whose names contain a
specific pattern or groups layers specified by their names or indices.
Group Layers by Pattern
groups the layers in the netUpdated
= groupLayers(net
)dlnetwork
object net
whose names start with any text followed by a colon into networkLayer
objects. Layers whose names start with the same pattern are grouped into the same network
layer. For example, the software groups layers named "subnet:fc"
and
"subnet:relu"
into a network layer named
"subnet"
.
Use this syntax to group the layers previously expanded by the expandLayers
function.
specifies the delimiter for grouping by pattern. For example, specifying
netUpdated
= groupLayers(net
,Delimiter=delim
)Delimiter="@"
groups layers whose names contain the pattern
"subnet@"
instead of "subnet:"
.
specifies whether to recursively group layers for each instance of the pattern in a layer
name or only for the first instance using any of the previous syntaxes.netUpdated
= groupLayers(___,Recursive=tf
)
Group Layers by Names or Indices
groups layers in netUpdated
= groupLayers(net
,groups
)net
specified by groups
into
networkLayer
objects.
groups layers in netUpdated
= groupLayers(net
,groups
,GroupNames=Names
)net
specified by groups
into
networkLayer
objects. The names of the network layers are specified by Names
.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2024a