2 * Copyright (c) 2023 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_BISECTION_VISQ_ERROR_APPROXIMATOR_H__
18 #define __MPQSOLVER_BISECTION_VISQ_ERROR_APPROXIMATOR_H__
28 class VISQErrorApproximator final
32 * @brief constructor of VISQErrorApproximator
34 VISQErrorApproximator() = default;
37 * @brief initiliaze by visq_data_path (throws on failure)
39 void init(const std::string &visq_data_path);
42 * @brief approximate error introduced while quantizing node into Q8
44 float approximate(const std::string &node_name) const;
48 * @brief initiliaze by visq_data (returns success)
50 bool init(std::istream &visq_data);
53 std::string _visq_data_path;
54 std::map<std::string, float> _layer_errors;
57 } // namespace bisection
58 } // namespace mpqsolver
60 #endif // __MPQSOLVER_BISECTION_VISQ_ERROR_APPROXIMATOR_H__