1 // 2 // Copyright © 2021 Arm Ltd and Contributors. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 # pragma once 6 7 #include <string> 8 #include <map> 9 #include "ArmnnNetworkExecutor.hpp" 10 11 namespace kws 12 { 13 14 /** 15 * @brief Decodes quantised last layer of model output 16 * 17 */ 18 class Decoder 19 { 20 private: 21 int quantisationOffset; 22 float quantisationScale; 23 24 public: 25 Decoder(int quantisationOffset,float quantisationScale)26 Decoder(int quantisationOffset, float quantisationScale) : quantisationOffset(quantisationOffset), 27 quantisationScale(quantisationScale) {} 28 29 std::pair<int, float> decodeOutput(std::vector<int8_t>& modelOutput); 30 31 }; 32 } // namespace kws