Starting in R2024a, DAGNetwork
, SeriesNetwork
,
and LayerGraph
objects are not recommended. Use dlnetwork
objects instead. This
recommendation means that the that plot
function is not
recommended with inputs of these objects.
To convert a trained DAGNetwork
or SeriesNetwork
object to a dlnetwork
object, use the dag2dlnetwork
function.
Most functions that support LayerGraph
objects also support
dlnetwork
objects. This table shows some typical usages of
LayerGraph
objects and how to update your code to use
dlnetwork
object functions instead.
Not Recommended | Recommended |
---|
lgraph = layerGraph; | net = dlnetwork; |
lgraph = layerGraph(layers); | net = dlnetwork(layers,Initialize=false); |
lgraph = layerGraph(net); | net = dag2dlnetwork(net); |
lgraph = addLayers(lgraph,layers); | net = addLayers(net,layers); |
lgraph = removeLayers(lgraph,layerNames); | net = removeLayers(net,layerNames); |
lgraph =
replaceLayer(lgraph,layerName,layers); | net = replaceLayer(net,layerName,layers); |
lgraph = connectLayers(lgraph,s,d); | net = connectLayers(net,s,d); |
lgraph = disconnectLayers(lgraph,s,d); | net = disconnectLayers(net,s,d); |
plot(lgraph); | plot(net); |
To train a neural network specified as a dlnetwork
object,
use the trainnet
function.