AnnaMats/ppo-Pyramids-Training
0110
1# Table of Contents2 3* [mlagents.trainers.trainer.on\_policy\_trainer](#mlagents.trainers.trainer.on_policy_trainer)4 * [OnPolicyTrainer](#mlagents.trainers.trainer.on_policy_trainer.OnPolicyTrainer)5 * [\_\_init\_\_](#mlagents.trainers.trainer.on_policy_trainer.OnPolicyTrainer.__init__)6 * [add\_policy](#mlagents.trainers.trainer.on_policy_trainer.OnPolicyTrainer.add_policy)7* [mlagents.trainers.trainer.off\_policy\_trainer](#mlagents.trainers.trainer.off_policy_trainer)8 * [OffPolicyTrainer](#mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer)9 * [\_\_init\_\_](#mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer.__init__)10 * [save\_model](#mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer.save_model)11 * [save\_replay\_buffer](#mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer.save_replay_buffer)12 * [load\_replay\_buffer](#mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer.load_replay_buffer)13 * [add\_policy](#mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer.add_policy)14* [mlagents.trainers.trainer.rl\_trainer](#mlagents.trainers.trainer.rl_trainer)15 * [RLTrainer](#mlagents.trainers.trainer.rl_trainer.RLTrainer)16 * [end\_episode](#mlagents.trainers.trainer.rl_trainer.RLTrainer.end_episode)17 * [create\_optimizer](#mlagents.trainers.trainer.rl_trainer.RLTrainer.create_optimizer)18 * [save\_model](#mlagents.trainers.trainer.rl_trainer.RLTrainer.save_model)19 * [advance](#mlagents.trainers.trainer.rl_trainer.RLTrainer.advance)20* [mlagents.trainers.trainer.trainer](#mlagents.trainers.trainer.trainer)21 * [Trainer](#mlagents.trainers.trainer.trainer.Trainer)22 * [\_\_init\_\_](#mlagents.trainers.trainer.trainer.Trainer.__init__)23 * [stats\_reporter](#mlagents.trainers.trainer.trainer.Trainer.stats_reporter)24 * [parameters](#mlagents.trainers.trainer.trainer.Trainer.parameters)25 * [get\_max\_steps](#mlagents.trainers.trainer.trainer.Trainer.get_max_steps)26 * [get\_step](#mlagents.trainers.trainer.trainer.Trainer.get_step)27 * [threaded](#mlagents.trainers.trainer.trainer.Trainer.threaded)28 * [should\_still\_train](#mlagents.trainers.trainer.trainer.Trainer.should_still_train)29 * [reward\_buffer](#mlagents.trainers.trainer.trainer.Trainer.reward_buffer)30 * [save\_model](#mlagents.trainers.trainer.trainer.Trainer.save_model)31 * [end\_episode](#mlagents.trainers.trainer.trainer.Trainer.end_episode)32 * [create\_policy](#mlagents.trainers.trainer.trainer.Trainer.create_policy)33 * [add\_policy](#mlagents.trainers.trainer.trainer.Trainer.add_policy)34 * [get\_policy](#mlagents.trainers.trainer.trainer.Trainer.get_policy)35 * [advance](#mlagents.trainers.trainer.trainer.Trainer.advance)36 * [publish\_policy\_queue](#mlagents.trainers.trainer.trainer.Trainer.publish_policy_queue)37 * [subscribe\_trajectory\_queue](#mlagents.trainers.trainer.trainer.Trainer.subscribe_trajectory_queue)38* [mlagents.trainers.settings](#mlagents.trainers.settings)39 * [deep\_update\_dict](#mlagents.trainers.settings.deep_update_dict)40 * [RewardSignalSettings](#mlagents.trainers.settings.RewardSignalSettings)41 * [structure](#mlagents.trainers.settings.RewardSignalSettings.structure)42 * [ParameterRandomizationSettings](#mlagents.trainers.settings.ParameterRandomizationSettings)43 * [\_\_str\_\_](#mlagents.trainers.settings.ParameterRandomizationSettings.__str__)44 * [structure](#mlagents.trainers.settings.ParameterRandomizationSettings.structure)45 * [unstructure](#mlagents.trainers.settings.ParameterRandomizationSettings.unstructure)46 * [apply](#mlagents.trainers.settings.ParameterRandomizationSettings.apply)47 * [ConstantSettings](#mlagents.trainers.settings.ConstantSettings)48 * [\_\_str\_\_](#mlagents.trainers.settings.ConstantSettings.__str__)49 * [apply](#mlagents.trainers.settings.ConstantSettings.apply)50 * [UniformSettings](#mlagents.trainers.settings.UniformSettings)51 * [\_\_str\_\_](#mlagents.trainers.settings.UniformSettings.__str__)52 * [apply](#mlagents.trainers.settings.UniformSettings.apply)53 * [GaussianSettings](#mlagents.trainers.settings.GaussianSettings)54 * [\_\_str\_\_](#mlagents.trainers.settings.GaussianSettings.__str__)55 * [apply](#mlagents.trainers.settings.GaussianSettings.apply)56 * [MultiRangeUniformSettings](#mlagents.trainers.settings.MultiRangeUniformSettings)57 * [\_\_str\_\_](#mlagents.trainers.settings.MultiRangeUniformSettings.__str__)58 * [apply](#mlagents.trainers.settings.MultiRangeUniformSettings.apply)59 * [CompletionCriteriaSettings](#mlagents.trainers.settings.CompletionCriteriaSettings)60 * [need\_increment](#mlagents.trainers.settings.CompletionCriteriaSettings.need_increment)61 * [Lesson](#mlagents.trainers.settings.Lesson)62 * [EnvironmentParameterSettings](#mlagents.trainers.settings.EnvironmentParameterSettings)63 * [structure](#mlagents.trainers.settings.EnvironmentParameterSettings.structure)64 * [TrainerSettings](#mlagents.trainers.settings.TrainerSettings)65 * [structure](#mlagents.trainers.settings.TrainerSettings.structure)66 * [CheckpointSettings](#mlagents.trainers.settings.CheckpointSettings)67 * [prioritize\_resume\_init](#mlagents.trainers.settings.CheckpointSettings.prioritize_resume_init)68 * [RunOptions](#mlagents.trainers.settings.RunOptions)69 * [from\_argparse](#mlagents.trainers.settings.RunOptions.from_argparse)70 71<a name="mlagents.trainers.trainer.on_policy_trainer"></a>72# mlagents.trainers.trainer.on\_policy\_trainer73 74<a name="mlagents.trainers.trainer.on_policy_trainer.OnPolicyTrainer"></a>75## OnPolicyTrainer Objects76 77```python78class OnPolicyTrainer(RLTrainer)79```80 81The PPOTrainer is an implementation of the PPO algorithm.82 83<a name="mlagents.trainers.trainer.on_policy_trainer.OnPolicyTrainer.__init__"></a>84#### \_\_init\_\_85 86```python87 | __init__(behavior_name: str, reward_buff_cap: int, trainer_settings: TrainerSettings, training: bool, load: bool, seed: int, artifact_path: str)88```89 90Responsible for collecting experiences and training an on-policy model.91 92**Arguments**:93 94- `behavior_name`: The name of the behavior associated with trainer config95- `reward_buff_cap`: Max reward history to track in the reward buffer96- `trainer_settings`: The parameters for the trainer.97- `training`: Whether the trainer is set for training.98- `load`: Whether the model should be loaded.99- `seed`: The seed the model will be initialized with100- `artifact_path`: The directory within which to store artifacts from this trainer.101 102<a name="mlagents.trainers.trainer.on_policy_trainer.OnPolicyTrainer.add_policy"></a>103#### add\_policy104 105```python106 | add_policy(parsed_behavior_id: BehaviorIdentifiers, policy: Policy) -> None107```108 109Adds policy to trainer.110 111**Arguments**:112 113- `parsed_behavior_id`: Behavior identifiers that the policy should belong to.114- `policy`: Policy to associate with name_behavior_id.115 116<a name="mlagents.trainers.trainer.off_policy_trainer"></a>117# mlagents.trainers.trainer.off\_policy\_trainer118 119<a name="mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer"></a>120## OffPolicyTrainer Objects121 122```python123class OffPolicyTrainer(RLTrainer)124```125 126The SACTrainer is an implementation of the SAC algorithm, with support127for discrete actions and recurrent networks.128 129<a name="mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer.__init__"></a>130#### \_\_init\_\_131 132```python133 | __init__(behavior_name: str, reward_buff_cap: int, trainer_settings: TrainerSettings, training: bool, load: bool, seed: int, artifact_path: str)134```135 136Responsible for collecting experiences and training an off-policy model.137 138**Arguments**:139 140- `behavior_name`: The name of the behavior associated with trainer config141- `reward_buff_cap`: Max reward history to track in the reward buffer142- `trainer_settings`: The parameters for the trainer.143- `training`: Whether the trainer is set for training.144- `load`: Whether the model should be loaded.145- `seed`: The seed the model will be initialized with146- `artifact_path`: The directory within which to store artifacts from this trainer.147 148<a name="mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer.save_model"></a>149#### save\_model150 151```python152 | save_model() -> None153```154 155Saves the final training model to memory156Overrides the default to save the replay buffer.157 158<a name="mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer.save_replay_buffer"></a>159#### save\_replay\_buffer160 161```python162 | save_replay_buffer() -> None163```164 165Save the training buffer's update buffer to a pickle file.166 167<a name="mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer.load_replay_buffer"></a>168#### load\_replay\_buffer169 170```python171 | load_replay_buffer() -> None172```173 174Loads the last saved replay buffer from a file.175 176<a name="mlagents.trainers.trainer.off_policy_trainer.OffPolicyTrainer.add_policy"></a>177#### add\_policy178 179```python180 | add_policy(parsed_behavior_id: BehaviorIdentifiers, policy: Policy) -> None181```182 183Adds policy to trainer.184 185<a name="mlagents.trainers.trainer.rl_trainer"></a>186# mlagents.trainers.trainer.rl\_trainer187 188<a name="mlagents.trainers.trainer.rl_trainer.RLTrainer"></a>189## RLTrainer Objects190 191```python192class RLTrainer(Trainer)193```194 195This class is the base class for trainers that use Reward Signals.196 197<a name="mlagents.trainers.trainer.rl_trainer.RLTrainer.end_episode"></a>198#### end\_episode199 200```python201 | end_episode() -> None202```203 204A signal that the Episode has ended. The buffer must be reset.205Get only called when the academy resets.206 207<a name="mlagents.trainers.trainer.rl_trainer.RLTrainer.create_optimizer"></a>208#### create\_optimizer209 210```python211 | @abc.abstractmethod212 | create_optimizer() -> TorchOptimizer213```214 215Creates an Optimizer object216 217<a name="mlagents.trainers.trainer.rl_trainer.RLTrainer.save_model"></a>218#### save\_model219 220```python221 | save_model() -> None222```223 224Saves the policy associated with this trainer.225 226<a name="mlagents.trainers.trainer.rl_trainer.RLTrainer.advance"></a>227#### advance228 229```python230 | advance() -> None231```232 233Steps the trainer, taking in trajectories and updates if ready.234Will block and wait briefly if there are no trajectories.235 236<a name="mlagents.trainers.trainer.trainer"></a>237# mlagents.trainers.trainer.trainer238 239<a name="mlagents.trainers.trainer.trainer.Trainer"></a>240## Trainer Objects241 242```python243class Trainer(abc.ABC)244```245 246This class is the base class for the mlagents_envs.trainers247 248<a name="mlagents.trainers.trainer.trainer.Trainer.__init__"></a>249#### \_\_init\_\_250 251```python252 | __init__(brain_name: str, trainer_settings: TrainerSettings, training: bool, load: bool, artifact_path: str, reward_buff_cap: int = 1)253```254 255Responsible for collecting experiences and training a neural network model.256 257**Arguments**:258 259- `brain_name`: Brain name of brain to be trained.260- `trainer_settings`: The parameters for the trainer (dictionary).261- `training`: Whether the trainer is set for training.262- `artifact_path`: The directory within which to store artifacts from this trainer263- `reward_buff_cap`:264 265<a name="mlagents.trainers.trainer.trainer.Trainer.stats_reporter"></a>266#### stats\_reporter267 268```python269 | @property270 | stats_reporter()271```272 273Returns the stats reporter associated with this Trainer.274 275<a name="mlagents.trainers.trainer.trainer.Trainer.parameters"></a>276#### parameters277 278```python279 | @property280 | parameters() -> TrainerSettings281```282 283Returns the trainer parameters of the trainer.284 285<a name="mlagents.trainers.trainer.trainer.Trainer.get_max_steps"></a>286#### get\_max\_steps287 288```python289 | @property290 | get_max_steps() -> int291```292 293Returns the maximum number of steps. Is used to know when the trainer should be stopped.294 295**Returns**:296 297The maximum number of steps of the trainer298 299<a name="mlagents.trainers.trainer.trainer.Trainer.get_step"></a>300#### get\_step301 302```python303 | @property304 | get_step() -> int305```306 307Returns the number of steps the trainer has performed308 309**Returns**:310 311the step count of the trainer312 313<a name="mlagents.trainers.trainer.trainer.Trainer.threaded"></a>314#### threaded315 316```python317 | @property318 | threaded() -> bool319```320 321Whether or not to run the trainer in a thread. True allows the trainer to322update the policy while the environment is taking steps. Set to False to323enforce strict on-policy updates (i.e. don't update the policy when taking steps.)324 325<a name="mlagents.trainers.trainer.trainer.Trainer.should_still_train"></a>326#### should\_still\_train327 328```python329 | @property330 | should_still_train() -> bool331```332 333Returns whether or not the trainer should train. A Trainer could334stop training if it wasn't training to begin with, or if max_steps335is reached.336 337<a name="mlagents.trainers.trainer.trainer.Trainer.reward_buffer"></a>338#### reward\_buffer339 340```python341 | @property342 | reward_buffer() -> Deque[float]343```344 345Returns the reward buffer. The reward buffer contains the cumulative346rewards of the most recent episodes completed by agents using this347trainer.348 349**Returns**:350 351the reward buffer.352 353<a name="mlagents.trainers.trainer.trainer.Trainer.save_model"></a>354#### save\_model355 356```python357 | @abc.abstractmethod358 | save_model() -> None359```360 361Saves model file(s) for the policy or policies associated with this trainer.362 363<a name="mlagents.trainers.trainer.trainer.Trainer.end_episode"></a>364#### end\_episode365 366```python367 | @abc.abstractmethod368 | end_episode()369```370 371A signal that the Episode has ended. The buffer must be reset.372Get only called when the academy resets.373 374<a name="mlagents.trainers.trainer.trainer.Trainer.create_policy"></a>375#### create\_policy376 377```python378 | @abc.abstractmethod379 | create_policy(parsed_behavior_id: BehaviorIdentifiers, behavior_spec: BehaviorSpec) -> Policy380```381 382Creates a Policy object383 384<a name="mlagents.trainers.trainer.trainer.Trainer.add_policy"></a>385#### add\_policy386 387```python388 | @abc.abstractmethod389 | add_policy(parsed_behavior_id: BehaviorIdentifiers, policy: Policy) -> None390```391 392Adds policy to trainer.393 394<a name="mlagents.trainers.trainer.trainer.Trainer.get_policy"></a>395#### get\_policy396 397```python398 | get_policy(name_behavior_id: str) -> Policy399```400 401Gets policy associated with name_behavior_id402 403**Arguments**:404 405- `name_behavior_id`: Fully qualified behavior name406 407**Returns**:408 409Policy associated with name_behavior_id410 411<a name="mlagents.trainers.trainer.trainer.Trainer.advance"></a>412#### advance413 414```python415 | @abc.abstractmethod416 | advance() -> None417```418 419Advances the trainer. Typically, this means grabbing trajectories420from all subscribed trajectory queues (self.trajectory_queues), and updating421a policy using the steps in them, and if needed pushing a new policy onto the right422policy queues (self.policy_queues).423 424<a name="mlagents.trainers.trainer.trainer.Trainer.publish_policy_queue"></a>425#### publish\_policy\_queue426 427```python428 | publish_policy_queue(policy_queue: AgentManagerQueue[Policy]) -> None429```430 431Adds a policy queue to the list of queues to publish to when this Trainer432makes a policy update433 434**Arguments**:435 436- `policy_queue`: Policy queue to publish to.437 438<a name="mlagents.trainers.trainer.trainer.Trainer.subscribe_trajectory_queue"></a>439#### subscribe\_trajectory\_queue440 441```python442 | subscribe_trajectory_queue(trajectory_queue: AgentManagerQueue[Trajectory]) -> None443```444 445Adds a trajectory queue to the list of queues for the trainer to ingest Trajectories from.446 447**Arguments**:448 449- `trajectory_queue`: Trajectory queue to read from.450 451<a name="mlagents.trainers.settings"></a>452# mlagents.trainers.settings453 454<a name="mlagents.trainers.settings.deep_update_dict"></a>455#### deep\_update\_dict456 457```python458deep_update_dict(d: Dict, update_d: Mapping) -> None459```460 461Similar to dict.update(), but works for nested dicts of dicts as well.462 463<a name="mlagents.trainers.settings.RewardSignalSettings"></a>464## RewardSignalSettings Objects465 466```python467@attr.s(auto_attribs=True)468class RewardSignalSettings()469```470 471<a name="mlagents.trainers.settings.RewardSignalSettings.structure"></a>472#### structure473 474```python475 | @staticmethod476 | structure(d: Mapping, t: type) -> Any477```478 479Helper method to structure a Dict of RewardSignalSettings class. Meant to be registered with480cattr.register_structure_hook() and called with cattr.structure(). This is needed to handle481the special Enum selection of RewardSignalSettings classes.482 483<a name="mlagents.trainers.settings.ParameterRandomizationSettings"></a>484## ParameterRandomizationSettings Objects485 486```python487@attr.s(auto_attribs=True)488class ParameterRandomizationSettings(abc.ABC)489```490 491<a name="mlagents.trainers.settings.ParameterRandomizationSettings.__str__"></a>492#### \_\_str\_\_493 494```python495 | __str__() -> str496```497 498Helper method to output sampler stats to console.499 500<a name="mlagents.trainers.settings.ParameterRandomizationSettings.structure"></a>501#### structure502 503```python504 | @staticmethod505 | structure(d: Union[Mapping, float], t: type) -> "ParameterRandomizationSettings"506```507 508Helper method to a ParameterRandomizationSettings class. Meant to be registered with509cattr.register_structure_hook() and called with cattr.structure(). This is needed to handle510the special Enum selection of ParameterRandomizationSettings classes.511 512<a name="mlagents.trainers.settings.ParameterRandomizationSettings.unstructure"></a>513#### unstructure514 515```python516 | @staticmethod517 | unstructure(d: "ParameterRandomizationSettings") -> Mapping518```519 520Helper method to a ParameterRandomizationSettings class. Meant to be registered with521cattr.register_unstructure_hook() and called with cattr.unstructure().522 523<a name="mlagents.trainers.settings.ParameterRandomizationSettings.apply"></a>524#### apply525 526```python527 | @abc.abstractmethod528 | apply(key: str, env_channel: EnvironmentParametersChannel) -> None529```530 531Helper method to send sampler settings over EnvironmentParametersChannel532Calls the appropriate sampler type set method.533 534**Arguments**:535 536- `key`: environment parameter to be sampled537- `env_channel`: The EnvironmentParametersChannel to communicate sampler settings to environment538 539<a name="mlagents.trainers.settings.ConstantSettings"></a>540## ConstantSettings Objects541 542```python543@attr.s(auto_attribs=True)544class ConstantSettings(ParameterRandomizationSettings)545```546 547<a name="mlagents.trainers.settings.ConstantSettings.__str__"></a>548#### \_\_str\_\_549 550```python551 | __str__() -> str552```553 554Helper method to output sampler stats to console.555 556<a name="mlagents.trainers.settings.ConstantSettings.apply"></a>557#### apply558 559```python560 | apply(key: str, env_channel: EnvironmentParametersChannel) -> None561```562 563Helper method to send sampler settings over EnvironmentParametersChannel564Calls the constant sampler type set method.565 566**Arguments**:567 568- `key`: environment parameter to be sampled569- `env_channel`: The EnvironmentParametersChannel to communicate sampler settings to environment570 571<a name="mlagents.trainers.settings.UniformSettings"></a>572## UniformSettings Objects573 574```python575@attr.s(auto_attribs=True)576class UniformSettings(ParameterRandomizationSettings)577```578 579<a name="mlagents.trainers.settings.UniformSettings.__str__"></a>580#### \_\_str\_\_581 582```python583 | __str__() -> str584```585 586Helper method to output sampler stats to console.587 588<a name="mlagents.trainers.settings.UniformSettings.apply"></a>589#### apply590 591```python592 | apply(key: str, env_channel: EnvironmentParametersChannel) -> None593```594 595Helper method to send sampler settings over EnvironmentParametersChannel596Calls the uniform sampler type set method.597 598**Arguments**:599 600- `key`: environment parameter to be sampled601- `env_channel`: The EnvironmentParametersChannel to communicate sampler settings to environment602 603<a name="mlagents.trainers.settings.GaussianSettings"></a>604## GaussianSettings Objects605 606```python607@attr.s(auto_attribs=True)608class GaussianSettings(ParameterRandomizationSettings)609```610 611<a name="mlagents.trainers.settings.GaussianSettings.__str__"></a>612#### \_\_str\_\_613 614```python615 | __str__() -> str616```617 618Helper method to output sampler stats to console.619 620<a name="mlagents.trainers.settings.GaussianSettings.apply"></a>621#### apply622 623```python624 | apply(key: str, env_channel: EnvironmentParametersChannel) -> None625```626 627Helper method to send sampler settings over EnvironmentParametersChannel628Calls the gaussian sampler type set method.629 630**Arguments**:631 632- `key`: environment parameter to be sampled633- `env_channel`: The EnvironmentParametersChannel to communicate sampler settings to environment634 635<a name="mlagents.trainers.settings.MultiRangeUniformSettings"></a>636## MultiRangeUniformSettings Objects637 638```python639@attr.s(auto_attribs=True)640class MultiRangeUniformSettings(ParameterRandomizationSettings)641```642 643<a name="mlagents.trainers.settings.MultiRangeUniformSettings.__str__"></a>644#### \_\_str\_\_645 646```python647 | __str__() -> str648```649 650Helper method to output sampler stats to console.651 652<a name="mlagents.trainers.settings.MultiRangeUniformSettings.apply"></a>653#### apply654 655```python656 | apply(key: str, env_channel: EnvironmentParametersChannel) -> None657```658 659Helper method to send sampler settings over EnvironmentParametersChannel660Calls the multirangeuniform sampler type set method.661 662**Arguments**:663 664- `key`: environment parameter to be sampled665- `env_channel`: The EnvironmentParametersChannel to communicate sampler settings to environment666 667<a name="mlagents.trainers.settings.CompletionCriteriaSettings"></a>668## CompletionCriteriaSettings Objects669 670```python671@attr.s(auto_attribs=True)672class CompletionCriteriaSettings()673```674 675CompletionCriteriaSettings contains the information needed to figure out if the next676lesson must start.677 678<a name="mlagents.trainers.settings.CompletionCriteriaSettings.need_increment"></a>679#### need\_increment680 681```python682 | need_increment(progress: float, reward_buffer: List[float], smoothing: float) -> Tuple[bool, float]683```684 685Given measures, this method returns a boolean indicating if the lesson686needs to change now, and a float corresponding to the new smoothed value.687 688<a name="mlagents.trainers.settings.Lesson"></a>689## Lesson Objects690 691```python692@attr.s(auto_attribs=True)693class Lesson()694```695 696Gathers the data of one lesson for one environment parameter including its name,697the condition that must be fullfiled for the lesson to be completed and a sampler698for the environment parameter. If the completion_criteria is None, then this is699the last lesson in the curriculum.700 701<a name="mlagents.trainers.settings.EnvironmentParameterSettings"></a>702## EnvironmentParameterSettings Objects703 704```python705@attr.s(auto_attribs=True)706class EnvironmentParameterSettings()707```708 709EnvironmentParameterSettings is an ordered list of lessons for one environment710parameter.711 712<a name="mlagents.trainers.settings.EnvironmentParameterSettings.structure"></a>713#### structure714 715```python716 | @staticmethod717 | structure(d: Mapping, t: type) -> Dict[str, "EnvironmentParameterSettings"]718```719 720Helper method to structure a Dict of EnvironmentParameterSettings class. Meant721to be registered with cattr.register_structure_hook() and called with722cattr.structure().723 724<a name="mlagents.trainers.settings.TrainerSettings"></a>725## TrainerSettings Objects726 727```python728@attr.s(auto_attribs=True)729class TrainerSettings(ExportableSettings)730```731 732<a name="mlagents.trainers.settings.TrainerSettings.structure"></a>733#### structure734 735```python736 | @staticmethod737 | structure(d: Mapping, t: type) -> Any738```739 740Helper method to structure a TrainerSettings class. Meant to be registered with741cattr.register_structure_hook() and called with cattr.structure().742 743<a name="mlagents.trainers.settings.CheckpointSettings"></a>744## CheckpointSettings Objects745 746```python747@attr.s(auto_attribs=True)748class CheckpointSettings()749```750 751<a name="mlagents.trainers.settings.CheckpointSettings.prioritize_resume_init"></a>752#### prioritize\_resume\_init753 754```python755 | prioritize_resume_init() -> None756```757 758Prioritize explicit command line resume/init over conflicting yaml options.759if both resume/init are set at one place use resume760 761<a name="mlagents.trainers.settings.RunOptions"></a>762## RunOptions Objects763 764```python765@attr.s(auto_attribs=True)766class RunOptions(ExportableSettings)767```768 769<a name="mlagents.trainers.settings.RunOptions.from_argparse"></a>770#### from\_argparse771 772```python773 | @staticmethod774 | from_argparse(args: argparse.Namespace) -> "RunOptions"775```776 777Takes an argparse.Namespace as specified in `parse_command_line`, loads input configuration files778from file paths, and converts to a RunOptions instance.779 780**Arguments**:781 782- `args`: collection of command-line parameters passed to mlagents-learn783 784**Returns**:785 786RunOptions representing the passed in arguments, with trainer config, curriculum and sampler787configs loaded from files.788 