predict
Compute deep learning network output for inference
Syntax
Description
Some deep learning layers behave differently during training and inference (prediction). For example, during training, dropout layers randomly set input elements to zero to help prevent overfitting, but during inference, dropout layers do not change the input.
To compute network outputs for inference, use the predict
function.
To compute network outputs for training, use the forward
function. For
prediction with SeriesNetwork
and DAGNetwork
objects, see
predict
.
Tip
For prediction with SeriesNetwork
and DAGNetwork
objects, see predict
.
[Y1,...,YN] = predict(___)
returns the
N
outputs Y1
, …, YN
during
inference for networks that have N
outputs using any of the previous
syntaxes.
[Y1,...,YK] = predict(___,'Outputs',
returns the outputs layerNames
)Y1
, …, YK
during inference for the
specified layers using any of the previous syntaxes.
[___] = predict(___,'Acceleration',
also specifies performance optimization to use during inference, in addition to the input
arguments in previous syntaxes. acceleration
)
[___,
also returns the updated network state.state
] = predict(___)