evorl.workflows.workflow¶
Module Contents¶
Classes¶
A Workflow Interface for EvoRL training pipelines. |
|
The base class for all Workflows. |
API¶
- class evorl.workflows.workflow.AbstractWorkflow[source]¶
Bases:
abc.ABCA 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.AbstractWorkflowThe 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
- 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]¶