2 * Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __MPQSOLVER_CORE_EVALUATOR_H__
18 #define __MPQSOLVER_CORE_EVALUATOR_H__
20 #include "ErrorMetric.h"
22 #include <luci/IR/Module.h>
23 #include <luci/CircleQuantizer.h>
33 class DatasetEvaluator final
37 * @brief create Evaluator for comparing output of ref_module on h5file
39 DatasetEvaluator(const luci::Module *ref_module, const std::string &h5file,
40 const ErrorMetric &metric);
41 DatasetEvaluator() = delete;
42 ~DatasetEvaluator() = default;
45 * @brief evaluate trgt_fq_module (fake-quantized)
46 * returns error-metric
48 float evaluate(const luci::Module *trgt_fq_module) const;
52 * @brief throws if there is something wrong with the module
54 void validate(const luci::Module *module) const;
57 const luci::Module *_ref_module = nullptr;
59 WholeOutput _ref_output;
60 const ErrorMetric *_metric = nullptr;
64 } // namespace mpqsolver
66 #endif //__MPQSOLVER_CORE_EVALUATOR_H__