ONE - On-device Neural Engine
Loading...
Searching...
No Matches
package.experimental.train.metrics.metric.Metric Class Reference

Public Member Functions

None reset_state (self)
 
None update_state (self, Any outputs, Any expecteds)
 
float result (self)
 

Detailed Description

Abstract base class for all metrics.

Definition at line 4 of file metric.py.

Member Function Documentation

◆ reset_state()

None package.experimental.train.metrics.metric.Metric.reset_state (   self)
Reset the metric's state.

Reimplemented in package.experimental.train.metrics.categorical_accuracy.CategoricalAccuracy.

Definition at line 8 of file metric.py.

8 def reset_state(self) -> None:
9 """
10 Reset the metric's state.
11 """
12 raise NotImplementedError
13

◆ result()

float package.experimental.train.metrics.metric.Metric.result (   self)
Compute and return the final metric value.

Returns:
    float: Metric value.

Reimplemented in package.experimental.train.metrics.categorical_accuracy.CategoricalAccuracy.

Definition at line 24 of file metric.py.

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

◆ update_state()

None package.experimental.train.metrics.metric.Metric.update_state (   self,
Any  outputs,
Any  expecteds 
)
Update the metric's state based on the outputs and expecteds.

Args:
    outputs (Any): Model outputs.
    expecteds (Any): Expected ground truth values.

Reimplemented in package.experimental.train.metrics.categorical_accuracy.CategoricalAccuracy.

Definition at line 14 of file metric.py.

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

The documentation for this class was generated from the following file: