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

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

Member Function Documentation

◆ calculateValue()

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

Definition at line 31 of file CrossEntropy.cpp.

33{
34 float result_value = 0.f;
35
36 for (uint32_t i = 0; i < flat_size; ++i)
37 {
38 result_value += target_data[i] * std::log(calculated_data[i] + float(10.0e-32));
39 }
40
41 return -result_value;
42}

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


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