The dag2dlnetwork function applies these adjustments to the input
network to make it compatible with dlnetwork functionality:
Remove the output layers — To specify the loss function when you train a neural
network, use the trainnet
function.
Replace fully connected layers with convolution layers — For neural networks that
require fully connected layers to output data with singleton spatial dimensions, the
dag2dlnetwork function replaces the fully connected layer with
the equivalent convolutional layer. Otherwise, the dag2dlnetwork
function does not replace the layer. In the output dlnetwork object,
the fully connected layer outputs data without spatial dimensions.
For networks that output singleton spatial dimensions, include a flatten layer —
For neural networks that output data with singleton spatial dimensions (for example, a
SqueezeNet neural network), the dag2dlnetwork function adds a
flatten layer at the end of network that removes the singleton spatial
dimensions.
Return an uninitialized network when they contains unsupported layers — If the
network contains layers that dlnetwork objects do not support, then
the function returns an uninitialized dlnetwork object. To remove or
replace unsupported layers in a dlnetwork object, use the removeLayers and replaceLayer functions, respectively.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.