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.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.