ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
metric.py
Go to the documentation of this file.
1class Metric:
2 """
3 Abstract base class for all metrics.
4 """
5 def reset_state(self):
6 """
7 Reset the metric's state.
8 """
9 raise NotImplementedError
10
11 def update_state(self, outputs, expecteds):
12 """
13 Update the metric's state based on the outputs and expecteds.
14 Args:
15 outputs (np.ndarray): Model outputs.
16 expecteds (np.ndarray): Expected ground truth values.
17 """
18 raise NotImplementedError
19
20 def result(self):
21 """
22 Compute and return the final metric value.
23 Returns:
24 float: Metric value.
25 """
26 raise NotImplementedError
update_state(self, outputs, expecteds)
Definition metric.py:11