metrics_wrapper
MetricsWrapper
Bases: EnvironmentWrapper
Wrapper for running programmatic metric checks during env stepping
Source code in OmniGibson/omnigibson/envs/metrics_wrapper.py
__init__(env)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
Environment
|
The environment to wrap |
required |
add_metric(name, metric)
Adds a data metric to track
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the metric. This will be the name printed out when displaying the aggregated results |
required |
metric
|
MetricBase
|
Metric to add |
required |
Source code in OmniGibson/omnigibson/envs/metrics_wrapper.py
aggregate_metrics(flatten=True)
Aggregates metrics information
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flatten
|
bool
|
Whether to flatten the metrics dictionary or not |
True
|
Returns:
| Type | Description |
|---|---|
dict
|
Keyword-mapped aggregated metrics information |
Source code in OmniGibson/omnigibson/envs/metrics_wrapper.py
remove_metric(name)
Removes a metric from the internally tracked ones
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the metric to remove |
required |