API reference¶
Every public name is documented in the pages below, one per area of the
library (listed in the sidebar), in the order in which it appears in the
source. The documentation is generated from the
docstrings of src/rl_mind, so it always describes the code of the version it
was built from — shown in the sidebar, and the one students get from PyPI.
Import conventions. Everything listed below (except the extra
environments, rl_mind.envs / rl_mind.mazemdp_env, and rl_mind.profiles)
is re-exported by the package, so both of these work:
from rl_mind import VecEnv, Transitions # short
from rl_mind.env import VecEnv # explicit, used by the sources
The extra environments are deliberately not re-exported: importing them
registers gymnasium environments, and importing rl_mind must have no side
effect.
Shapes. B is the number of parallel environments, N a flat batch size,
T a number of time steps. A “structure” is a TensorStruct: a frozen
dataclass whose fields are tensors, indexed and stacked as a whole.
Reading the signatures. Constructor arguments are documented on
__init__; the fields of a dataclass (Action, EnvStep, Transitions,
Rollout, Episode, EvalResult) are documented as :param: entries of the
class itself, since that is how they are passed.
At a glance¶
The names a training loop is made of, in the order they come into play:
Name |
What it is for |
Page |
|---|---|---|
the policy: |
||
what an actor returns |
||
the base of every container: index, stack, concatenate |
||
|
||
what one step of a |
||
off-policy data, and where it is kept |
||
episodic and on-policy data |
||
off-policy collection (DQN, DDPG, TD3, SAC) |
||
whole episodes (REINFORCE) |
||
|
||
periodic evaluation, keeps the best actor |
||
watching an environment live in a notebook |
||
network helpers |
||
where a run writes its outputs |