classificationLayer
(Not recommended) Classification output layer
classificationLayer
is not recommended. Use the trainnet
function and set the loss function to "crossentropy"
instead. For
more information, see Version
History.
Description
A classification layer computes the cross-entropy loss for classification and weighted classification tasks with mutually exclusive classes.
The layer infers the number of classes from the output size of the previous layer. For example, to specify the number of classes K of the network, you can include a fully connected layer with output size K and a softmax layer before the classification layer.
sets the optional layer
= classificationLayer(Name,Value
)Name
, ClassWeights
, and
Classes
properties using one or more name-value pairs. For
example, classificationLayer('Name','output')
creates a
classification layer with the name 'output'
.
Examples
Input Arguments
Output Arguments
More About
References
[1] Bishop, C. M. Pattern Recognition and Machine Learning. Springer, New York, NY, 2006.