evorl.metrics¶
Module Contents¶
Classes¶
Training metrics for ECWorkflow. |
|
Workflow metrics for ECWorkflow. |
|
Evaluation metrics for RLWorkflow. |
|
Base class for all metrics. |
|
Workflow metrics for MultiObjectiveECWorkflow. |
|
Training metrics for RLWorkflow. |
|
Workflow metrics for RLWorkflow. |
Functions¶
Define a metric field in |
|
API¶
- class evorl.metrics.ECTrainMetric[source]¶
Bases:
evorl.metrics.MetricBaseTraining metrics for ECWorkflow.
- Variables:
objectives – The objective values for current step.
ec_metrics – The extra metrics of the training step.
- ec_metrics: chex.ArrayTree¶
None
- objectives: chex.Array¶
None
- class evorl.metrics.ECWorkflowMetric[source]¶
Bases:
evorl.metrics.MetricBaseWorkflow metrics for ECWorkflow.
- Variables:
best_objective – The best objective value found so far.
sampled_episodes – The total number of sampled episodes from environments..
sampled_timesteps_m – The total number of sampled timesteps from environments, measured in millions.
iterations – The total number of workflow iterations.
- best_objective: chex.Array¶
None
- iterations: chex.Array¶
‘zeros(…)’
- sampled_episodes: chex.Array¶
‘zeros(…)’
- sampled_timesteps_m: chex.Array¶
‘zeros(…)’
- class evorl.metrics.EvaluateMetric[source]¶
Bases:
evorl.metrics.MetricBaseEvaluation metrics for RLWorkflow.
- Variables:
episode_returns – The return array of evaluation episodes.
episode_lengths – The length array of evaluation episodes.
- episode_lengths: chex.Array¶
‘metric_field(…)’
- episode_returns: chex.Array¶
‘metric_field(…)’
- class evorl.metrics.MetricBase[source]¶
Bases:
evorl.types.PyTreeDataBase class for all metrics.
- class evorl.metrics.MultiObjectiveECWorkflowMetric[source]¶
Bases:
evorl.metrics.MetricBaseWorkflow metrics for MultiObjectiveECWorkflow.
- Variables:
sampled_episodes – The total number of sampled episodes from environments..
sampled_timesteps_m – The total number of sampled timesteps from environments, measured in millions.
iterations – The total number of workflow iterations.
- iterations: chex.Array¶
‘zeros(…)’
- sampled_episodes: chex.Array¶
‘zeros(…)’
- sampled_timesteps_m: chex.Array¶
‘zeros(…)’
- class evorl.metrics.TrainMetric[source]¶
Bases:
evorl.metrics.MetricBaseTraining metrics for RLWorkflow.
- Variables:
train_episode_return – The return of the training episode.
loss – The loss value of the training step.
raw_loss_dict – The raw loss dict of the training step.
- loss: chex.Array¶
‘zeros(…)’
- raw_loss_dict: evorl.types.LossDict¶
‘metric_field(…)’
- train_episode_return: chex.Array | None¶
None
- class evorl.metrics.WorkflowMetric[source]¶
Bases:
evorl.metrics.MetricBaseWorkflow metrics for RLWorkflow.
- Variables:
sampled_timesteps – The total number of sampled timesteps from environments.
iterations – The total number of workflow iterations.
- iterations: chex.Array¶
‘zeros(…)’
- sampled_episodes: chex.Array¶
‘zeros(…)’
- sampled_timesteps: chex.Array¶
‘zeros(…)’
- evorl.metrics.metric_field(*, reduce_fn: collections.abc.Callable[[chex.Array, str | None], chex.Array] = None, static=False, **kwargs)[source]¶
Define a metric field in
MetricBase.- Parameters:
reduce_fn – A function to reduce the metric value across different devices. For example,
jax.meanstatic – Whether the field is static related to pytree.
- Returns:
A dataclass field.