evorl.evaluators.episode_collector

Module Contents

Classes

EpisodeCollector

Evaluate and return eval metrics and episodic trajectory.

API

class evorl.evaluators.episode_collector.EpisodeCollector[source]

Bases: evorl.types.PyTreeNode

Evaluate and return eval metrics and episodic trajectory.

EpisodeCollector is similar as Evaluator, but it also returns the trajectories. When evaluating the agent, call rollout().

Variables:
  • env – Vectorized environment w/o autoreset.

  • action_fn – The agent action function.

  • max_episode_steps – The maximum number of steps in an episode.

  • env_extra_fields – The extra fields to collect from the environment.

  • discount – The discount factor.

action_fn: evorl.agent.AgentActionFn

None

discount: float

1.0

env: evorl.envs.Env

None

env_extra_fields: collections.abc.Sequence[str]

()

max_episode_steps: int

‘pytree_field(…)’

rollout(agent_state, key: chex.PRNGKey, num_episodes: int) tuple[evorl.metrics.EvaluateMetric, evorl.sample_batch.SampleBatch][source]
rollout_fn: evorl.rollout.RolloutFn

‘pytree_field(…)’