# Policy learners This package holds the policy learners selected with `--policy` and the components they share. This page is a map of the package for developers; to run a learner, use the [training guide](training.md). ## Layout | Location | Responsibilities | | --- | --- | | [base.py](https://github.com/GTLIDAR/ImitationLab/blob/main/imitationlab/algorithms/base.py) | Learner contract for training, prediction, and checkpoints | | [ppo/](https://github.com/GTLIDAR/ImitationLab/tree/main/imitationlab/algorithms/ppo) | Policy and value updates with GAE, optional recurrent policies, and distributed PPO | | [supermimic/](https://github.com/GTLIDAR/ImitationLab/tree/main/imitationlab/algorithms/supermimic) | Backpropagation through imagined trajectories | | [svg/](https://github.com/GTLIDAR/ImitationLab/tree/main/imitationlab/algorithms/svg) | Real-window rollouts with inferred action noise and dynamics residuals | | [diffsr/](https://github.com/GTLIDAR/ImitationLab/tree/main/imitationlab/algorithms/diffsr) | Policy updates through a differentiable spectral dynamics readout | | [common/](https://github.com/GTLIDAR/ImitationLab/tree/main/imitationlab/algorithms/common) | Configuration, collection, network utilities, and value targets | GAE is generalized advantage estimation. The `supermimic`, `svg`, and `diffsr` learners are the world-model learners. ## Shared components - [The training runtime](https://github.com/GTLIDAR/ImitationLab/blob/main/imitationlab/runners/algorithm_runtime.py) handles collection, metrics, checkpointing, and time budgets. - The world-model learners share [model fitting and replay](https://github.com/GTLIDAR/ImitationLab/tree/main/imitationlab/algorithms/common/world_model). - The [task protocol](https://github.com/GTLIDAR/ImitationLab/blob/main/imitationlab/algorithms/common/world_model/task.py) lets the task supply the same observation, action, reward, and reset definitions to simulated and imagined trajectories. ## Related code and guides - Latent command interfaces and encoder pretraining live in [encoders/](https://github.com/GTLIDAR/ImitationLab/tree/main/imitationlab/encoders). - The CPU algorithm tests live in [tests/](https://github.com/GTLIDAR/ImitationLab/tree/main/imitationlab/algorithms/tests); run them with `pixi run --locked test-algorithms`. - [Architecture](architecture.md) describes the package boundaries. ## License See [LICENSE](https://github.com/GTLIDAR/ImitationLab/blob/main/imitationlab/algorithms/LICENSE) and the [third-party notices](https://github.com/GTLIDAR/ImitationLab/blob/main/imitationlab/algorithms/THIRD_PARTY_NOTICES.md) for the code's provenance.