SingleEnvRewardCallback
Full path:
schola.scripts.sb3.utils.SingleEnvRewardCallback
schola.scripts.sb3.utils.SingleEnvRewardCallback
SingleEnvRewardCallback
SingleEnvRewardCallback(verbose=0, id=0, frequency=10)Bases: BaseCallback
Callback for logging rewards and steps taken by a single environment inside a vector environment.
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.
episode_reward
episode_rewardThe reward for the current episode.
Type
- float
episode_rewards
episode_rewardsThe rewards for each episode.
Type
- List[float]
episode_steps
episode_stepsThe number of steps taken in the current episode.
Type
- int
step_count
step_countThe number of steps taken in each episode.
Type
- List[int]
last_logging_interval
last_logging_intervalThe last interval that was logged.
Type
- int
logging_interval_size
logging_interval_sizeThe frequency at which to log the rewards and steps taken.
Type
- int
id
idThe id of the environment to log rewards and steps for.
Type
- int
Methods
| Item | Description |
|---|---|
| init | — |
| get_reward_interval | Returns the rewards for the last logging interval. |
| get_step_interval | Returns the steps taken for each episode in the last logging interval. |
| increment_logging_interval | Increments the logging interval by self.logging_interval_size steps. |
Attributes
| Item | Description |
|---|---|
| ready_to_log | Returns whether the environment is ready to log, by checking if there are more episodes completed than self.logging_interval_size since we last logged. |
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.
Return type: List[float]
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.
Return type: List[int]
increment_logging_interval
increment_logging_interval()Increments the logging interval by self.logging_interval_size steps.
Returns
None
ready_to_log
ready_to_log: boolReturns whether the environment is ready to log, by checking if there are more episodes completed than self.logging_interval_size since we last logged.