ONE - On-device Neural Engine
Loading...
Searching...
No Matches
mpqsolver::core::DatasetEvaluator Class Referencefinal

#include <Evaluator.h>

Public Member Functions

 DatasetEvaluator (const luci::Module *ref_module, const DataProvider &provider, const ErrorMetric &metric)
 create Evaluator for comparing output of ref_module on provider
 
 DatasetEvaluator ()=delete
 
 ~DatasetEvaluator ()=default
 
float evaluate (const luci::Module *trgt_fq_module) const
 evaluate trgt_fq_module (fake-quantized) returns error-metric
 

Detailed Description

Definition at line 35 of file Evaluator.h.

Constructor & Destructor Documentation

◆ DatasetEvaluator() [1/2]

DatasetEvaluator::DatasetEvaluator ( const luci::Module ref_module,
const DataProvider provider,
const ErrorMetric metric 
)

create Evaluator for comparing output of ref_module on provider

Definition at line 98 of file Evaluator.cpp.

100 : _ref_module(ref_module), _provider(&provider), _metric(&metric)
101{
102 _ref_output = compute_outputs(_ref_module, _provider);
103}

◆ DatasetEvaluator() [2/2]

mpqsolver::core::DatasetEvaluator::DatasetEvaluator ( )
delete

◆ ~DatasetEvaluator()

mpqsolver::core::DatasetEvaluator::~DatasetEvaluator ( )
default

Member Function Documentation

◆ evaluate()

float DatasetEvaluator::evaluate ( const luci::Module trgt_fq_module) const

evaluate trgt_fq_module (fake-quantized) returns error-metric

Definition at line 117 of file Evaluator.cpp.

118{
119 if (trgt_fq_module == nullptr)
120 throw std::runtime_error("Invalid target module");
121
122 if (_metric == nullptr)
123 throw std::runtime_error("Invalid metric");
124
125 validate(trgt_fq_module);
126
127 const WholeOutput &cur_output = compute_outputs(trgt_fq_module, _provider);
128 float error = _metric->compute(_ref_output, cur_output);
129 return error;
130}
virtual float compute(const WholeOutput &first, const WholeOutput &second) const =0
abstract method for comparing first and second operands
Severity error(void)
Definition Severity.h:76
std::vector< Output > WholeOutput
Definition ErrorMetric.h:29

References mpqsolver::core::ErrorMetric::compute().


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