classificationLayer
Classification output layer
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.
creates a classification
layer.layer
= classificationLayer
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.
Extended Capabilities
Version History
Introduced in R2016a