2023-07-17 19:28:43 +01:00
.. only :: comment
2023-07-21 14:54:09 +01:00
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
2023-07-17 19:28:43 +01:00
2023-07-12 09:16:40 +01:00
.. _run a primaite session:
2024-02-26 11:02:37 +00:00
.. admonition :: Deprecated
:class: deprecated
PrimAITE Session is being deprecated in favour of Jupyter Notebooks. The `` session `` command will be removed in future releases, but example notebooks will be provided to demonstrate the same functionality.
2023-06-08 15:57:38 +01:00
Run a PrimAITE Session
======================
2023-11-23 03:07:39 +00:00
`` PrimaiteSession `` allows the user to train or evaluate an RL agent on the primaite simulation with just a config file,
no code required. It manages the lifecycle of a training or evaluation session, including the setup of the environment,
policy, simulator, agents, and IO.
2023-10-25 23:32:52 +01:00
2023-11-23 03:07:39 +00:00
If you want finer control over the RL policy, you can interface with the :py:module:: `primaite.session.environment`
module directly without running a session.
2023-10-25 23:32:52 +01:00
2023-11-23 03:07:39 +00:00
Run
---
2023-10-25 23:32:52 +01:00
2023-11-24 09:28:50 +00:00
A PrimAITE session can be started either with the `` primaite session `` command from the cli
2023-11-23 03:07:39 +00:00
(See :func: `primaite.cli.session` ), or by calling :func: `primaite.main.run` from a Python terminal or Jupyter Notebook.
2023-10-25 23:32:52 +01:00
2023-11-23 03:07:39 +00:00
There are two parameters that can be specified:
- `` --config `` : The path to the config file to use. If not specified, the default config file is used.
- `` --agent-load-file `` : The path to the pre-trained agent to load. If not specified, a new agent is created.
2023-10-25 23:32:52 +01:00
2023-11-23 03:07:39 +00:00
Outputs
-------
2023-10-25 23:32:52 +01:00
2023-11-24 09:28:50 +00:00
Running a session creates a session output directory in your user data folder. The filepath looks like this:
`` ~/primaite/3.0.0/sessions/YYYY-MM-DD/HH-MM-SS/ `` . This folder contains the simulation sys logs generated by each node,
2023-12-01 16:37:58 +00:00
the saved agent checkpoints, and final model. The folder also contains a .json file for each episode step that
contains the action, reward, and simulation state. These can be found in
`` ~/primaite/3.0.0/sessions/YYYY-MM-DD/HH-MM-SS/simulation_output/episode_<n>/step_metadata/step_<n>.json ``