Categories &

Functions List

Function Reference: fcnnpredict

statistics: pred_Y = fcnnpredict (Mdl, XC)
statistics: pred_Y = fcnnpredict @ (Mdl, XC, NumThreads)
statistics: [pred_Y, scores] = fcnnpredict (…)

Make predictions from a fully connected Neural Network.

pred_Y = fcnnpredict (Mdl, XC) requires the following input arguments.

  • Mdl : A structure containing the trained model parameters as generated by the fcnntrain function.
  • XC : An N×M matrix containing the data set to be predicted upon. Rows N correspond to individual samples and columns M correspond to features (dimensions). Type of XC must be double and the number of features must correspond to those of the trained model.

fcnnpredict can also be called with a third input argument, in which case, NumThreads, a positive scalar integer value, defines the number of of threads to be used when computing the activation layers. For layers with less than 1000 neurons, NumThreads always defaults to 1. fcnnpredict returns the predicted labels, pred_Y, and if a second output argument is requested, it also returns the corresponding values of the neural networks output in scores.

Installation Note: in order to support parallel processing on MacOS, users have to manually add support for OpenMP by adding the following flags to CFLAGS and CXXFLAGS prior to installing the statistics package:

setenv ("CPPFLAGS", "-I/opt/homebrew/opt/libomp/include -Xclang -fopenmp")

See also: fcnntrain, fitcnet, ClassificationNeuralNetwork

Source Code: fcnnpredict