Root Mean Squared Error.
More...
#include <mnist_mlp.hpp>
|
static Real | calc_loss (const uint16_t label, const std::vector< Real > &output) |
|
static std::vector< Real > | calc_error (const uint16_t label, const std::vector< Real > &output) |
|
Root Mean Squared Error.
Definition at line 34 of file mnist_mlp.hpp.
static std::vector<Real> MNIST::MSE::calc_error |
( |
const uint16_t |
label, |
|
|
const std::vector< Real > & |
output |
|
) |
| |
|
inlinestatic |
Definition at line 51 of file mnist_mlp.hpp.
54 std::vector<Real> res(output.size(), 0.0);
55 for (
size_t neuron = 0; neuron < output.size(); neuron++) {
56 if (
label == neuron) {
57 res[neuron] = output[neuron] - 1.0;
60 res[neuron] = output[neuron] - 0.0;
static Real MNIST::MSE::calc_loss |
( |
const uint16_t |
label, |
|
|
const std::vector< Real > & |
output |
|
) |
| |
|
inlinestatic |
Definition at line 36 of file mnist_mlp.hpp.
40 for (
size_t neuron = 0; neuron < output.size(); neuron++) {
41 if (
label == neuron) {
42 res += (output[neuron] - 1.0) * (output[neuron] - 1.0);
45 res += output[neuron] * output[neuron];
48 res = sqrt(res / Real(output.size()));
The documentation for this class was generated from the following file: