evorl.workflows.workflow

Module Contents

Classes

AbstractWorkflow

A Workflow Interface for EvoRL training pipelines.

Workflow

The base class for all Workflows.

API

class evorl.workflows.workflow.AbstractWorkflow[source]

Bases: abc.ABC

A Workflow Interface for EvoRL training pipelines.

abstract init(key: chex.PRNGKey) evorl.types.State[source]

Initialize the workflow’s state.

Parameters:

key – JAX PRNGKey

Returns:

the state of the workflow

Return type:

state

classmethod name() str[source]

Define the name of the workflow (eg. PPO, PSO, etc.).

Default workflow name is its class name.

abstract step(state: evorl.types.State) tuple[Any, evorl.types.State][source]

Define the logic of one training iteration.

class evorl.workflows.workflow.Workflow(config: omegaconf.DictConfig)[source]

Bases: evorl.workflows.workflow.AbstractWorkflow

The base class for all Workflows.

All workflow classes are inherit from this class, and customize by implementing

add_recorders(recorders: evorl.recorders.Recorder) None[source]
abstract classmethod build_from_config(config: omegaconf.DictConfig, *args, **kwargs) typing_extensions.Self[source]

Build the workflow instance from the config.

This is the public API to call for instantiating a new workflow object from config. Normally, it will call init() and do some pre- and post-processing.

Parameters:

config – config object

Returns:

A workflow instance

close() None[source]

Close the workflow’s components.

init(key: chex.PRNGKey) evorl.types.State[source]

Initialize the state of the .

This is the public API to call for instance state initialization.

abstract learn(state: evorl.types.State) evorl.types.State[source]

Run the complete learning process.

The learning process includes:

  • call multiple times of step()

  • record the metrics

  • save checkpoints

abstract setup(key: chex.PRNGKey) evorl.types.State[source]