MATLAB: What is the difference between LayerGraph and DAGNetwork in deep learning

dagnetworkdeep learningDeep Learning Toolboxlayergraphneural network

I find that the data structure of LayerGraph and DAGNetwork in neural network toolbox have the same contents. So, is there any difference between them?

Best Answer

LayerGraphs and Layers contain the network architecture (for DAGs and Series networks, respectively). These objects are then passed to trainNetwork for validation and training. LayerGraphs and Layers may have weights or not, but they cannot be used for prediction. One can only call prediction on DAGNetwork and SeriesNetwork objects. These objects contain the validated and trained network.
From R2018b to convert a LayerGraph and Layers object with weights and all the needed parameters to a DAGNetwork/SeriesNetwork one can call assembleNetwork, example:
net = assembleNetwork(layers);
Related Question