1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
6 * @brief This is a header file for the ICNNNetworkStats class
8 * @file ie_icnn_network_stats.hpp
18 #include "details/ie_irelease.hpp"
20 namespace InferenceEngine {
22 class NetworkNodeStats;
24 * @brief A shared pointer to the NetworkNodeStats object
26 using NetworkNodeStatsPtr = std::shared_ptr<NetworkNodeStats>;
28 * @brief A smart pointer to the NetworkNodeStats object
30 using NetworkNodeStatsWeakPtr = std::weak_ptr<NetworkNodeStats>;
32 * @brief A map of pairs: name of a layer and related statistics
34 using NetworkStatsMap = std::map<std::string, NetworkNodeStatsPtr>;
36 * @class ICNNNetworkStats
37 * @brief This is the interface to describe the NN topology scoring statistics
39 class ICNNNetworkStats : public details::IRelease {
42 * @brief Sets a map which contains layers with statistics
44 * @param stats A map which is set
47 virtual void setNodesStats(const NetworkStatsMap& stats) = 0;
49 * @brief Gets a map which contains layers with statistics
52 * @return A NetworkStatsMap object
54 virtual const NetworkStatsMap& getNodesStats() const = 0;
56 * @brief Checks if a container is empty
59 * @return A bool value which shows whether a container is empty
61 virtual bool isEmpty() const = 0;
65 * @class NetworkNodeStats
66 * @brief This class implements a container which stores statistics for a layer
68 class NetworkNodeStats {
71 * @brief The constructor which creates NetworkNodeStats object
75 * @brief The constructor which creates NetworkNodeStats object with filled statistics
77 * @param statCount The number of minimum/maximum values in statistics
79 explicit NetworkNodeStats(int statCount) {
80 float mn = (std::numeric_limits<float>::max)();
81 float mx = (std::numeric_limits<float>::min)();
83 for (int i = 0; i < statCount; i++) {
84 _minOutputs.push_back(mn);
85 _maxOutputs.push_back(mx);
91 * @brief Vector of floats which contains minimum values of layers activations
93 std::vector<float> _minOutputs;
95 * @brief Vector of floats which contains maximum values of layers activations
97 std::vector<float> _maxOutputs;
100 } // namespace InferenceEngine