Callback
lerax.callback.AbstractCallbackStepState
Bases:
Base class for callback states that are vectorized across environment steps.
lerax.callback.AbstractCallbackState
Bases:
Base class for callback states.
lerax.callback.ResetContext
Bases:
Context passed to the reset method of callbacks.
lerax.callback.StepContext
Bases:
Values passed to step-related callback methods.
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
The current callback step state. |
|
|
The environment being interacted with. |
|
|
The policy being used to interact with the environment. |
|
|
Boolean indicating if the episode has terminated or truncated. |
|
|
Reward received from the environment at the current step. |
|
|
A dictionary for storing additional information. |
lerax.callback.IterationContext
Bases:
Values passed to iteration-related callback methods.
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
The current callback state. |
|
|
The current callback step state. |
|
|
The environment being interacted with. |
|
|
The policy being used to interact with the environment. |
|
|
The current training iteration count. |
|
|
The current optimizer state. |
|
|
A dictionary containing training metrics. |
|
|
A dictionary for storing additional information. |
lerax.callback.TrainingContext
Bases:
Values passed to training-related callback methods.
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
The current callback state. |
|
|
The current callback step state. |
|
|
The environment being interacted with. |
|
|
The policy being used to interact with the environment. |
|
|
Total number of timesteps for training. |
|
|
The current training iteration count. |
|
|
A dictionary for storing additional information. |
lerax.callback.AbstractCallback
Bases:
Base class for RL algorithm callbacks.
Note
All concrete methods should work under JIT compilation.
reset
abstractmethod
Initialize the callback state.
step_reset
abstractmethod
Reset the callback state for vectorized steps.
on_step
abstractmethod
Called at the end of each environment step.
on_iteration
abstractmethod
Called at the end of each training iteration.
on_training_start
abstractmethod
Called at the start of training.
lerax.callback.AbstractStatelessCallback
Bases:
Callback that does not maintain any state.
on_step
abstractmethod
Called at the end of each environment step.
on_iteration
abstractmethod
Called at the end of each training iteration.
on_training_start
abstractmethod
Called at the start of training.
lerax.callback.AbstractStepCallback
Bases:
Callback that only implements step-related methods.
lerax.callback.AbstractIterationCallback
Bases:
Callback that only implements iteration-related methods.
lerax.callback.AbstractTrainingCallback
Bases:
Callback that only implements training-related methods.
reset
abstractmethod
Initialize the callback state.
on_training_start
abstractmethod
Called at the start of training.