Context
- class srl.base.context.RunContext(env_config: EnvConfig = None, rl_config: RLConfig = None, callbacks: ~typing.List[~srl.base.run.callback.RunCallback] = <factory>, run_name: ~typing.Literal['main', 'trainer', 'actor', 'eval'] = 'main', play_mode: str = '', max_episodes: int = 0, timeout: float = 0, max_steps: int = 0, max_train_count: int = 0, max_memory: int = 0, players: ~typing.Sequence[None | str | ~typing.Tuple[str, dict] | RLConfig | ~typing.Tuple[RLConfig, ~typing.Any]] = <factory>, shuffle_player: bool = True, disable_trainer: bool = False, train_interval: int = 1, train_repeat: int = 1, distributed: bool = False, training: bool = False, train_only: bool = False, rollout: bool = False, env_render_mode: ~typing.Literal['', 'terminal', 'rgb_array', 'window', 'terminal_rgb_array'] = '', rl_render_mode: ~typing.Literal['', 'terminal', 'rgb_array', 'window', 'terminal_rgb_array'] = '', actor_num: int = 1, actor_devices: str | ~typing.List[str] = 'CPU', memory_limit: int | None = -1, enable_stats: bool = True, seed: int | None = None, seed_enable_gpu: bool = False, device: str = 'AUTO', enable_tf_device: bool = True, set_CUDA_VISIBLE_DEVICES_if_CPU: bool = True, tf_enable_memory_growth: bool = True)
実行時の状態をまとめたクラス A class that summarizes the runtime state
- play_mode: str = ''
実行時の関数名がはいります(yamlで指定できるのは["train", "train_mp", "rollout", "train_only", "evaluate"])
- max_episodes: int = 0
[終了条件] 実行が終了するまでのエピソード数
- timeout: float = 0
[終了条件] 実行が終了するまでの時間(秒)
- max_steps: int = 0
[終了条件] 実行が終了するまでの総ステップ数
- max_train_count: int = 0
[終了条件] 実行が終了するまでの学習回数
- max_memory: int = 0
[終了条件] 実行が終了するまでのRLのメモリサイズ
- players: Sequence[None | str | Tuple[str, dict] | RLConfig | Tuple[RLConfig, Any]]
二人以上の環境で他プレイヤーが使うアルゴリズムを指定
- shuffle_player: bool = True
二人以上の環境でプレイヤーをシャッフルするかどうか
- train_interval: int = 1
1学習間隔に対するstep回数、例えば5にすると1学習5stepになる
- train_repeat: int = 1
1回の学習での学習回数、例えば5にすると1step5学習になる
- actor_num: int = 1
分散学習時のactorの数
- actor_devices: str | List[str] = 'CPU'
分散学習時のactorの使うデバイス
- memory_limit: int | None = -1
PC側のメモリ制限(linuxで有効) None : not change <=0 : auto int : 指定サイズで設定
- enable_stats: bool = True
統計情報を収集するか
- seed: int | None = None
random seed
- seed_enable_gpu: bool = False
GPU時にseedを固定するか
- device: str = 'AUTO'
使うデバイス
- enable_tf_device: bool = True
tf時に with tf.device() での実行を有効にするか
- set_CUDA_VISIBLE_DEVICES_if_CPU: bool = True
CPU時に CUDA_VISIBLE_DEVICES 環境変数で無効にするか
- tf_enable_memory_growth: bool = True
tensorflowにて、'set_memory_growth(True)' を実行する