Skip to content

SB3ScriptArgs

Full path: schola.scripts.sb3.settings.SB3ScriptArgs

schola.scripts.sb3.settings.SB3ScriptArgs

SB3ScriptArgs

SB3ScriptArgs(timesteps=3000, pbar=False, disable_eval=False, logging_settings=<factory>, resume_settings=<factory>, checkpoint_settings=<factory>, network_architecture_settings=<factory>, algorithm_settings=<factory>, environment_settings=<factory>)

Bases: object

Top level dataclass for configuring the script arguments used in the SB3 launcher.

Methods

ItemDescription
init

Attributes

ItemDescription
disable_evalWhether to disable running evaluation after training.
name_prefix
pbarWhether to display a progress bar during training.
timestepsTotal number of timesteps to train the agent.
logging_settingsSettings for enabling logging and configuring the logging directory.
resume_settingsSettings for resuming training from a checkpoint.
checkpoint_settingsSettings for enabling checkpointing and configuring the checkpoint directory.
network_architecture_settingsSettings for configuring the neural network architecture used for training.
algorithm_settingsThe settings for the training algorithm to use.
environment_settingsSettings for the environment to use during training

Parameters

timesteps (int)

pbar (bool)

disable_eval (bool)

logging_settings (Annotated[Sb3LoggingArgs, Parameter(name=('*',), group=('Logging Arguments',))])

resume_settings (Annotated[Sb3ResumeArgs, Parameter(name=('*',), group=('Resume Arguments',))])

checkpoint_settings (Annotated[Sb3CheckpointArgs, Parameter(name=('*',), group=('Checkpoint Arguments',))])

network_architecture_settings (Annotated[Sb3NetworkArchitectureArgs, Parameter(name=('*',), group=('Network Architecture Arguments',))])

algorithm_settings (Annotated[PPOSettings | SACSettings, Parameter(parse=False, show=False)])

environment_settings (Annotated[EnvironmentArgs, Parameter(name=('*',), group=('Environment Arguments',))])

init

__init__(timesteps=3000, pbar=False, disable_eval=False, logging_settings=<factory>, resume_settings=<factory>, checkpoint_settings=<factory>, network_architecture_settings=<factory>, algorithm_settings=<factory>, environment_settings=<factory>)

Parameters

timesteps (int)

pbar (bool)

disable_eval (bool)

logging_settings (Annotated[Sb3LoggingArgs, Parameter(name=('*',), group=('Logging Arguments',))])

resume_settings (Annotated[Sb3ResumeArgs, Parameter(name=('*',), group=('Resume Arguments',))])

checkpoint_settings (Annotated[Sb3CheckpointArgs, Parameter(name=('*',), group=('Checkpoint Arguments',))])

network_architecture_settings (Annotated[Sb3NetworkArchitectureArgs, Parameter(name=('*',), group=('Network Architecture Arguments',))])

algorithm_settings (Annotated[PPOSettings | SACSettings, Parameter(parse=False, show=False)])

environment_settings (Annotated[EnvironmentArgs, Parameter(name=('*',), group=('Environment Arguments',))])

Returns

None


algorithm_settings

algorithm_settings: Annotated[
PPOSettings | SACSettings, Parameter(parse=False, show=False)
]

The settings for the training algorithm to use. This can be either PPOSettings or SACSettings, depending on the chosen algorithm. This property allows for easy switching between different algorithms (e.g., PPO or SAC) by simply changing the instance of the settings class. The default is PPOSettings, which is suitable for most environments unless specified otherwise.


checkpoint_settings

checkpoint_settings: Annotated[
Sb3CheckpointArgs, Parameter(name="*", group="Checkpoint Arguments")
]

Settings for enabling checkpointing and configuring the checkpoint directory.


disable_eval

= False disable_eval: bool

Whether to disable running evaluation after training. When set to True, it will skip evaluation after training completes.


environment_settings

environment_settings: Annotated[
EnvironmentArgs, Parameter(name="*", group="Environment Arguments")
]

Settings for the environment to use during training


logging_settings

logging_settings: Annotated[
Sb3LoggingArgs, Parameter(name="*", group="Logging Arguments")
]

Settings for enabling logging and configuring the logging directory.


name_prefix

name_prefix

network_architecture_settings

network_architecture_settings: Annotated[
Sb3NetworkArchitectureArgs,
Parameter(name="*", group="Network Architecture Arguments"),
]

Settings for configuring the neural network architecture used for training.


pbar

= False pbar: bool

Whether to display a progress bar during training. Requires TQDM and Rich to be installed.


resume_settings

resume_settings: Annotated[Sb3ResumeArgs, Parameter(name="*", group="Resume Arguments")]

Settings for resuming training from a checkpoint.


timesteps

= 3000 timesteps: int

Total number of timesteps to train the agent. This is the total number of environment steps that will be used for training. This should be set based on the complexity of the environment and the desired training duration. A higher value will typically lead to better performance but will also increase training time.