Skip to content

SingleEnvRewardCallback

Full path: schola.scripts.sb3.utils.SingleEnvRewardCallback

Callback for logging rewards and steps taken by a single environment inside a vector environment.

SingleEnvRewardCallback(verbose = 0, id = 0, frequency = 10)

Parameters

  • verbose (int) - Verbosity level.

  • id (int) - The id of the environment to log rewards and steps for.

  • frequency (int) - The frequency at which to log the rewards and steps taken.

Methods

init

__init__(verbose = 0, id = 0, frequency = 10)

get_reward_interval

get_reward_interval()

Returns the rewards for the last logging interval.

Returns

The rewards for the last logging interval.


get_step_interval

get_step_interval()

Returns the steps taken for each episode in the last logging interval.

Returns

The steps taken for each episode in the last logging interval.


increment_logging_interval

increment_logging_interval()

Increments the logging interval by self.logging_interval_size steps.

Returns

Return type: None

Attributes

episode_reward

episode_reward : float

The reward for the current episode.


episode_rewards

episode_rewards : List[float]

The rewards for each episode.


episode_steps

episode_steps : int

The number of steps taken in the current episode.


step_count

step_count : List[int]

The number of steps taken in each episode.


last_logging_interval

last_logging_interval : int

The last interval that was logged.


logging_interval_size

logging_interval_size : int

The frequency at which to log the rewards and steps taken.


id

id : int

The id of the environment to log rewards and steps for.


ready_to_log

ready_to_log