ONE - On-device Neural Engine
Loading...
Searching...
No Matches
metric.py
Go to the documentation of this file.
1from typing import Any
2
3
4class Metric:
5 """
6 Abstract base class for all metrics.
7 """
8 def reset_state(self) -> None:
9 """
10 Reset the metric's state.
11 """
12 raise NotImplementedError
13
14 def update_state(self, outputs: Any, expecteds: Any) -> None:
15 """
16 Update the metric's state based on the outputs and expecteds.
17
18 Args:
19 outputs (Any): Model outputs.
20 expecteds (Any): Expected ground truth values.
21 """
22 raise NotImplementedError
23
24 def result(self) -> float:
25 """
26 Compute and return the final metric value.
27
28 Returns:
29 float: Metric value.
30 """
31 raise NotImplementedError
None update_state(self, Any outputs, Any expecteds)
Definition metric.py:14