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

#include <MAE.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 MAE.h.

Member Function Documentation

◆ calculateValue()

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

Definition at line 30 of file MAE.cpp.

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

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


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