ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert_micro::train::metrics::MSE Struct Reference

#include <MSE.h>

Static Public Member Functions

static float calculateValue (const uint32_t flat_size, const float *calculated_data, const float *target_data)
 

Detailed Description

Definition at line 31 of file MSE.h.

Member Function Documentation

◆ calculateValue()

float MSE::calculateValue ( const uint32_t  flat_size,
const float *  calculated_data,
const float *  target_data 
)
static

Definition at line 30 of file MSE.cpp.

32{
33 float result_value = 0.f;
34
35 for (uint32_t i = 0; i < flat_size; ++i)
36 {
37 const auto cur_val = calculated_data[i] - target_data[i];
38 result_value += cur_val * cur_val;
39 }
40
41 assert(flat_size != 0);
42
43 return result_value / static_cast<float>(flat_size);
44}

Referenced by onert_micro::core::train::OMTrainingHandler::evaluateMetric().


The documentation for this struct was generated from the following files: