nnlib
GPU-accelerated, C/C++ neural network library.
|
The implementation of categorical accuracy. More...
#include <metric.h>
Public Member Functions | |
CategoricalAccuracy () | |
Constructor of CategoricalAccuracy. | |
float | calculateMetric (const sTensor &targets, const sTensor &predictions) override |
Calcualate the current value of the metric given the new batches of targets and predictions. More... | |
std::string | getShortName () const override |
Short string identifier of the metric. More... | |
![]() | |
Metric () | |
Constructor for the Metric class. More... | |
void | reset () |
Reset the metric, i.e.: set numSamples and currentTotalMetric to 0. | |
Additional Inherited Members | |
![]() | |
size_t | numSamples |
The number of samples processed so far. | |
float | currentTotalMetric |
The current total value of the metric. | |
The implementation of categorical accuracy.
This metric requires the targets to consist of only 0s and 1s, with 1s corresponding to the correct class. The rows are the samples, the columns are the classes. The predictions can consist of any real value, the largest value is assumed to be the predicted class.
|
overridevirtual |
Calcualate the current value of the metric given the new batches of targets and predictions.
targets | The desired outputs of the network. |
predictions | The actual outputs of the network. |
Implements Metric.
|
overridevirtual |
Short string identifier of the metric.
Used when printing the value of the metric to the terminal.
Implements Metric.