assembleNetwork - (Not recommended) Assemble deep learning network from pretrained layers - MATLAB (original) (raw)
assembleNetwork
is not recommended. Use dlnetwork objects instead.
The assembleNetwork
function returns SeriesNetwork
and DAGNetwork
objects, which are not recommended. There are no plans to remove support for the assembleNetwork
function. However,dlnetwork
objects are recommended instead and have these advantages:
dlnetwork
objects are a unified data type that supports network building, prediction, built-in training, visualization, compression, verification, and custom training loops.dlnetwork
objects support a wider range of network architectures that you can create or import from external platforms.- The trainnet function supports
dlnetwork
objects, which enables you to easily specify loss functions. You can select from built-in loss functions or specify a custom loss function. - Training and prediction with
dlnetwork
objects is typically faster thanLayerGraph
andtrainNetwork
workflows.
To update your code to use dlnetwork
objects, use one of these options:
Not Recommended | Recommended |
---|---|
Assemble SeriesNetwork or DAGNetwork object using a layer array or layer graph. | Build dlnetwork object directly and do not include any output layers. Most functions that supportLayerGraph objects also support dlnetwork objects. To initialize the network, use the initialize function. |
Assemble imported network returned by theimportKerasLayers,importTensorFlowLayers, orimportONNXLayers functions. | Import the network using the importNetworkFromTensorFlow or importNetworkFromONNX functions. |