Multiple-Input and Multiple-Output Networks
In Deep Learning Toolbox™, you can define network architectures with multiple inputs (for example, networks trained on multiple sources and types of data) or multiple outputs (for example, networks that predicts both classification and regression responses).
Define networks with multiple inputs when the network requires data from multiple sources or in different formats. For example, networks that require image data captured from multiple sensors at different resolutions.
To define and train a deep learning network with multiple inputs, specify the
network architecture using a
dlnetwork object and train using the
trainnet function, respectively.
To use a datastore for networks with multiple input layers, use the
transform functions to create a
datastore that outputs a cell array with (
numInputs + 1) columns, where
numInputs is the number of network inputs. In this case, the first
numInputs columns specify the predictors for each input and the last
column specifies the responses. The order of inputs is given by the
InputNames property of the layer graph
For an example showing how to train a network with both image and feature input, see Train Network on Image and Feature Data.
If the network also has multiple outputs, then you must use a custom training loop. for more information, see Multiple-Output Networks.
multiple numeric arrays
Define networks with multiple outputs for tasks requiring multiple responses in different formats. For example, tasks requiring both categorical and numeric output.
To train a deep learning network with multiple outputs, use a custom training loop. For an example, see Train Network with Multiple Outputs.
To make predictions using a model function, use the model function directly with the trained parameters. For an example, see Make Predictions Using Model Function.
Alternatively, convert the model function to a
function. With the assembled network, you can:
For an example, see Assemble Multiple-Output Network for Prediction.