CAccuracyLayer Class
February 12, 2021 ยท View on GitHub
This class implements a layer that calculates classification accuracy, that is, the proportion of objects classified correctly in the set.
Settings
Resetting the data after each run
void SetReset( bool value );
Specifies if the data should be reset after each network run. By default, the reset is turned on.
If you turn off this setting, the total accuracy since the last reset will be calculated.
Trainable parameters
This layer has no trainable parameters.
Inputs
The layer has two inputs. The first input accepts a blob with the network response, of the dimensions:
BatchLength * BatchWidth * ListSizeis equal to the number of objects that were classified.Height,Width, andDepthare equal to1.Channelsis equal to1for binary classification and to the number of classes if there are more than 2.
The second input should contain a blob with the correct class labels:
- If first input
Channelsis equal to1, the labels for the binary classification should contain1for one class and-1for the other. - If
Channelsis greater than1for the multiple labels classification two forms are allowed:- labels should contain a blob of the same dimensions with 1 for correct class and 0 for the others.
- labels should contain a blob with
Channels= 1 with correct label indexes. Both types CT_Float and CT_Int are allowed.
Outputs
The single output returns a blob with only one element, which contains the proportion of correctly classified objects among all objects.
If you have set SetReset() to false, the layer will accumulate the data for all network runs since the last reset.