schola.scripts.sb3.utils.SingleEnvRewardCallback

class schola.scripts.sb3.utils.SingleEnvRewardCallback(verbose=0, id=0, frequency=10)[source]

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

The reward for the current episode.

Type:

float

episode_rewards

The rewards for each episode.

Type:

List[float]

episode_steps

The number of steps taken in the current episode.

Type:

int

step_count

The number of steps taken in each episode.

Type:

List[int]

last_logging_interval

The last interval that was logged.

Type:

int

logging_interval_size

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

Type:

int

id

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

Type:

int

Methods

__init__([verbose, id, frequency])

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.

init_callback(model)

Initialize the callback by saving references to the RL model and the training environment for convenience.

on_rollout_end()

on_rollout_start()

on_step()

This method will be called by the model after each call to env.step().

on_training_end()

on_training_start(locals_, globals_)

update_child_locals(locals_)

Update the references to the local variables on sub callbacks.

update_locals(locals_)

Update the references to the local variables.

Attributes

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.

model

logger

__init__(verbose=0, id=0, frequency=10)[source]
get_reward_interval()[source]

Returns the rewards for the last logging interval.

Returns:

The rewards for the last logging interval.

Return type:

List[float]

get_step_interval()[source]

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()[source]

Increments the logging interval by self.logging_interval_size steps.

Return type:

None

property ready_to_log: bool

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.

Returns:

Whether the environment is ready to log.

Return type:

bool

Related pages

  • Visit the Schola product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNA™ 2 GPUs, AMD Ryzen™ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!