ONE - On-device Neural Engine
Loading...
Searching...
No Matches
metric.py
Go to the documentation of this file.
1
from
typing
import
Any
2
3
4
class
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
package.experimental.train.metrics.metric.Metric
Definition
metric.py:4
package.experimental.train.metrics.metric.Metric.update_state
None update_state(self, Any outputs, Any expecteds)
Definition
metric.py:14
package.experimental.train.metrics.metric.Metric.result
float result(self)
Definition
metric.py:24
package.experimental.train.metrics.metric.Metric.reset_state
None reset_state(self)
Definition
metric.py:8
runtime
onert
api
python
package
experimental
train
metrics
metric.py
Generated by
1.9.8