ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
metrics.registry.MetricsRegistry Class Reference

Static Public Member Functions

 create_metric (name)
 

Static Protected Attributes

dict _metrics
 

Detailed Description

Registry for creating metrics by name.

Definition at line 4 of file registry.py.

Member Function Documentation

◆ create_metric()

metrics.registry.MetricsRegistry.create_metric (   name)
static
Create a metric instance by name.
Args:
    name (str): Name of the metric.
Returns:
    BaseMetric: Metric instance.

Definition at line 13 of file registry.py.

13 def create_metric(name):
14 """
15 Create a metric instance by name.
16 Args:
17 name (str): Name of the metric.
18 Returns:
19 BaseMetric: Metric instance.
20 """
21 if name not in MetricsRegistry._metrics:
22 raise ValueError(
23 f"Unknown Metric: {name}. Custom metric is not supported yet")
24 return MetricsRegistry._metrics[name]()

Field Documentation

◆ _metrics

dict metrics.registry.MetricsRegistry._metrics
staticprotected
Initial value:
= {
"categorical_accuracy": CategoricalAccuracy,
}

Definition at line 8 of file registry.py.


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