Skip to content

Progress Bar Callback

lerax.callback.progress_bar.ProgressBarCallbackStepState

Bases: AbstractCallbackStepState

State for ProgressBarCallback at each step.

Attributes:

Name Type Description
steps Int[Array, '']

Number of steps taken in the current iteration.

lerax.callback.ProgressBarCallback

Bases: AbstractCallback[EmptyCallbackState, ProgressBarCallbackStepState]

Callback for displaying a progress bar during training.

Note

If the callback is instantiated inside a JIT-compiled function, it may not work correctly.

Attributes:

Name Type Description
progress_bar JITProgressBar

JITProgressBar instance for displaying progress.

Parameters:

Name Type Description Default
total_timesteps int | None

Total number of timesteps for the progress bar.

None
name str | None

Name of the progress bar. If None, a default name is generated from the environment and policy names.

None
env AbstractEnvLike | None

The environment being trained on. Used for naming if name is None.

None
policy AbstractPolicy | None

The policy being trained. Used for naming if name is None.

None

__init__

__init__(
    total_timesteps: int | None = None,
    name: str | None = None,
    env: AbstractEnvLike | None = None,
    policy: AbstractPolicy | None = None,
)

reset

reset(ctx: ResetContext, *, key: Key) -> EmptyCallbackState

step_reset

step_reset(
    ctx: ResetContext, *, key: Key
) -> ProgressBarCallbackStepState

on_step

on_step(
    ctx: StepContext, *, key: Key
) -> ProgressBarCallbackStepState

on_iteration

on_iteration(
    ctx: IterationContext, *, key: Key
) -> EmptyCallbackState

on_training_start

on_training_start(
    ctx: TrainingContext, *, key: Key
) -> EmptyCallbackState

on_training_end

on_training_end(
    ctx: TrainingContext, *, key: Key
) -> EmptyCallbackState