TensorBoard Callback
lerax.callback.tensorboard.TensorBoardCallbackStepState
Bases:
State for TensorBoardCallback.
Records cumulative episode returns and lengths, and the exponential moving average of them over episodes.
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
Current training step. |
|
|
Cumulative return for the current episode. |
|
|
Length of the current episode. |
|
|
Boolean indicating if the current episode is done. |
|
|
Exponential moving average of episode returns. |
|
|
Exponential moving average of episode lengths. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step
|
|
Current training step. |
required |
episode_return
|
|
Cumulative return for the current episode. |
required |
episode_length
|
|
Length of the current episode. |
required |
episode_done
|
|
Boolean indicating if the current episode is done. |
required |
average_return
|
|
Exponential moving average of episode returns. |
required |
average_length
|
|
Exponential moving average of episode lengths. |
required |
lerax.callback.TensorBoardCallback
Bases:
Callback for recording training statistics to TensorBoard.
Each training iteration, the following statistics are logged: - episode/return: The exponential moving average of episode returns. - episode/length: The exponential moving average of episode lengths. - train/: - learning_rate: The current learning rate. - ...: Any other statistics in the training log.
Note
If the callback is instantiated inside a JIT-compiled function, it may not work correctly.
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
The TensorBoard summary writer. |
|
|
Smoothing factor for exponential moving averages. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
|
Name for the TensorBoard log directory. If None, a name is generated based on the current time, environment name, and policy name. |
None
|
env
|
|
The environment being trained on. Used for naming if |
None
|
policy
|
|
The policy being trained. Used for naming if |
None
|
alpha
|
|
Smoothing factor for exponential moving averages. |
0.9
|