Changelog¶
Versions follow semantic versioning; before 1.0, a breaking change bumps
the minor version. Each release is tagged vX.Y.Z on main and published to
PyPI as ajax-rl.
0.7.0¶
2026-11-30. What a user of 0.6.0 meets:
- MuJoCo Warp by default on an NVIDIA GPU. Playground and
"mujoco:"tasks step MuJoCo Warp there, 15 times faster than pure JAX for 50 HalfCheetah-v5 environments on an L40S, so GPU results differ from 0.6.0's;physics="jax"keeps pure JAX. - Faster training on a GPU. On-policy rollouts run as one CUDA graph
(
uv.lockinstalls the CUDA 12.9 runtime), and off-policy agents choose their warm-up action with a select and plan their updates before the run. On an L40S with 10 seeds, PPO on CartPole-v1 went from 707,000 to 1,002,000 env steps a second. - Every CPU core and groups of seeds. With
JAX_NUM_CPU_DEVICESset,trainsplits a CPU run's seeds over the devices it gives;train(runs_at_once=...)trains the seeds in groups. - A progress bar on a terminal or in a notebook, and less compiling: a call's chunks and evaluations compile once each.
- Speeds against other libraries, in figures in the README and on the performance page: SAC, TD3, PPO, DQN and PQN timed in Ajax and in Stable-Baselines3, SBX, CleanRL, PureJaxRL, Brax and purejaxql at 1, 10 and 50 seeds, and how long a 1,000,000-step run takes.
- No hang at the end of training when a logging worker dies, as 0.6.0 could.
The changes in full follow. "Upgrading from 0.6.0", after them, gives what to do for each change that can break code or results.
Changes since 0.6.0¶
- A logging worker that dies no longer hangs the end of training.
Stopping the worker waited for it to handle every message, which a dead
worker never does: one that died as training ended, such as a worker
importing a script that trains without
if __name__ == "__main__":, hungtrainfor good. The stop now waits on the worker's process, at most 300 s for it to write and close its backends, and warns that the logs are missing when the worker died. A program whose dead worker left more unwritten logs than a pipe holds no longer hangs at exit either. 0.6.0 had both hangs. - The GPU-gain timings run MuJoCo on Warp, and the gain by seeds moves to
HalfCheetah. The performance guide's gain of one L40S over four CPU
cores with 1, 10 and 50 seeds is now timed on HalfCheetah-v5 through
gymnasium-mjx, the speed comparison's task, and on Breakout-MinAtar. On
MuJoCo, the GPU steps MuJoCo Warp (the default) and the CPU pure JAX, the
seeds split over one JAX device per core. The timing table stays on the
benchmark's CheetahRun, re-timed the same way with 10 seeds, so the time
axes of the benchmark's score-against-hours figures move from pure JAX to
Warp. The timing script (
time_agents.py) now takes each speed from the steps a timed call trains beyond a shorter, warm one. It used to time one resumed call whole, counting its fixed cost (about 2.3 s a call with Warp) and the first resumed call's one-off work as training. - Two more speed figures, in the README and the guide, light and dark.
The wall clock each library takes to train every seed for 1,000,000 steps
with 1, 10 and 50 seeds, Ajax on HalfCheetah both on MuJoCo Warp and on
MJX's pure JAX; and a table of Ajax's speed over each library's with as
many seeds ("45× faster", "1.5× slower"), each library on its faster
device. A new "How long a run takes" section sets full 1,000,000-step
runs of SAC against the figure (within 5%, within 2% from 10 seeds) and
gives Ajax's start-up, cold and warm, for each cell
(
benchmarks/speed/speed_figure.py;drive.py --mjxtimes either physics). - On a GPU, off-policy agents plan their updates before they run.
Which steps update follows from
learning_starts,train_frequencyand the steps each tick collects. On a GPU the training loop now works it out on the host, where it used to gate every step's update with alax.cond, a slow conditional node of the step's graph there. CPU runs are unchanged. On an NVIDIA L40S, DQN on CartPole-v1 with 10 seeds trains 1.34 times as many env steps a second (263,000 against 197,000), and SAC on Pendulum-v1 3% more.train(unroll_ticks=True)compiles the steps between two updates one after another, for long GPU runs: DQN then trains 1.64 times as fast as before, but each call compiles about 16 s longer. The algorithms are unchanged.
Upgrading: off-policy runs on a GPU can change by rounding.
- Off-policy agents step faster on a GPU. The warm-up's choice between
the uniform action and the policy's is an elementwise select instead of a
lax.cond, which on a GPU was a slow conditional node in every step's
graph, and a run that logs nothing no longer keeps its last update's
metrics, so their computation (the gradients' norm, the loss statistics)
is dropped. On an NVIDIA L40S, DQN on CartPole-v1 with 10 seeds trains
24% more env steps a second, SAC on Pendulum-v1 4%. The algorithms are
unchanged: DQN and TD3 train bit for bit as before, and some runs of the
SAC family move by float32 rounding. An unlogged run's
last_update_metrics stays NaN.
Upgrading: on a CPU too, runs that pass through the SAC family's
policy step can change by rounding: SAC with an expert, an action
transform or a warm-up chooser, the warm-ups of ASAC, CrossQ and REDQ,
and IQL trained online.
- On-policy rollouts run as one CUDA graph on a GPU. uv.lock now
installs the CUDA 12.9 runtime (12.6 before). Below 12.9, XLA keeps a
rollout step's writes into the rollout out of the step's CUDA graph, so
each step ran as several pieces, each launched by the CPU. Separately,
the episode-keyed auto-reset of gymnax environments no longer makes XLA
copy the env state at every step. On an L40S with 10 seeds, in env steps
per second, all seeds together:
- PPO on CartPole-v1: 707,000 to 1,002,000.
- REINFORCE on CartPole-v1: 755,000 to 1,063,000.
- APO on Pendulum-v1: 382,000 to 475,000.
- PQN on CartPole-v1: 1,997,000 to 2,176,000.
The off-policy agents are unchanged. pip already installs the newest CUDA wheels. An environment held to an older CUDA runtime (by a PyTorch built for CUDA 12.6, say) keeps the slower rollouts.
Upgrading: GPU runs can change by rounding.
- MuJoCo Warp is the default physics on an NVIDIA GPU. Playground and
"mujoco:" tasks now step MuJoCo Warp on a GPU wherever it can run
(physics="auto", the new default of build_env_from_id), and MJX's
pure-JAX physics elsewhere: on a CPU, on a MuJoCo before 3.13, without
the warp package, and with differentiable_reset=True. On an L40S, 50
HalfCheetah-v5 environments stepped 15 times faster on Warp. Runs on a
CPU do not change.
Upgrading: a GPU run of these tasks now steps other physics, so its
results differ from 0.6.0's. To keep pure JAX, build the environment
with build_env_from_id(env_id, n_envs=..., physics="jax") and pass it
to the agent with the same n_envs; resume a GPU run saved under 0.6.0
that way too. Warp's contact buffer has a fixed room, so a very large
batch of seeds and envs can now stop with an error that names
physics="jax".
- Every CPU core. With JAX_NUM_CPU_DEVICES set before JAX starts (or
jax.config.update("jax_num_cpu_devices", n) before importing Ajax), JAX
shows a CPU as several devices, and train splits a run's seeds over them
without devices=, as devices= splits them over GPUs. On four of bob's
cores, PPO on MJX HalfCheetah-v5 trains 2.5 times as fast with 10 seeds
and 14 times as fast with 50, DQN on CartPole-v1 1.8 to 1.9 times, SAC on
Pendulum-v1 1.2 times. One seed, a Gymnasium environment and an
evaluation_device keep a run on one device. The run config records how
many devices trained (devices). Without the setting, a CPU run whose
seeds could split says once how to split them, with the number of cores
the process can use; a chosen count (JAX_NUM_CPU_DEVICES=1 included)
leaves the note out.
Upgrading: a process that already showed several CPU devices now splits
its CPU runs, which changes their results by rounding;
devices=jax.devices("cpu")[:1] keeps one device.
- Docs: many MJX simulations at once on a CPU. From about 20 MJX
simulations at once (the seeds times their environments), XLA's CPU
compiler hands the small sums of MJX's constraint solver to YNNPACK, which
runs them 3 to 4 times slower than XLA's own loops. The performance page
gives the flag that keeps them in XLA's loops,
XLA_FLAGS=--xla_cpu_experimental_ynn_fusion_type=-reduce, and when to
set it: PPO on HalfCheetah with 50 seeds trained 3.6 times as fast with
it on one device, while the agents without MJX ran from 25% slower to 38%
faster. Ajax does not set it. Split over CPU devices (above), each device
counts its own simulations.
- train(runs_at_once=...) trains a run's seeds (or a sweep's runs) in
consecutive groups of that many, one group after another, each seed as it
would with all of them at once, but for rounding. On a GPU a group can fit
a cache that all the seeds overflow: REDQ's GPU speed fell from 563 env
steps per second at 10 seeds to 360 at 50 because its ten critics
outgrow an NVIDIA L40S's 96 MB L2 cache past about 12 seeds, and its 50
seeds ran 1.7 times as fast 5 at a time. The printed progress gives a
line per group, and a CPU run in groups stays on one device. None, the
default, trains every seed at once as before.
- Docs: speeds on one GPU. The performance page's timing table adds one
NVIDIA L40S beside the four CPU cores, with each agent's gain, and replaces
the dated comparison of 2026-11-06. The benchmark's score-against-time
figures count hours on that GPU, and the README's speed line gives the new
gains.
- Docs: the GPU's gain by number of seeds. A figure and a table give
each agent's gain at 1, 10 and 50 seeds trained together (DreamerV3 at 1
and 10). On the CPU, where JAX's one device trains every seed, most
agents train about as many steps a second at 50 seeds as at 10; on the
L40S they train more, so most gains grow with the seeds, SAC's from 15 to
44 times. The timing script takes --seeds.
- Docs: speed against other libraries. The performance page ("Against
other libraries") times SAC, TD3, PPO, DQN and PQN in Ajax and in
Stable-Baselines3, SBX, CleanRL, PureJaxRL, Brax and purejaxql, with the
same settings, at 1, 10 and 50 seeds, each library on four CPU cores or
one NVIDIA L40S, whichever trains it faster, on cores no other process
used (benchmarks/speed/). With 10 seeds Ajax trains SAC and TD3 8.3 to
76.7 times as fast as the fastest other library on each task, PPO 0.9 to
1.1 times, DQN and PQN 1.0 to 1.3 times. "One seed and many" shows, on
PPO HalfCheetah, why SB3 is faster with one seed (a step of MJX's physics
takes about 0.6 ms on four CPU cores, one of C MuJoCo's about 0.03 ms)
and that Ajax on one L40S passes it from about a dozen seeds. The
harness runs Ajax's two timed calls once untimed first on every device,
as it already did with several CPU devices: the first resumed call's
one-off work had overstated Ajax's single-device speeds, by about 12% for
PPO on HalfCheetah with one seed on a CPU. The 48 records it affected
were timed again; with one seed on a CPU, PPO on CartPole-v1 now trains
at 0.93 times PureJaxRL's speed.
- REINFORCE declares reward_learning: it learns from the reward. The
expert modules that need it (ExpertActionInput, ResidualPolicy,
ExpertGains, OuterLoopReference) are still refused on REINFORCE, now
for the right reason: it takes no expert_policy yet (NotWired), not a
capability its algorithm lacks.
- IQL stores its expert's actions (stores_expert_actions), as the
other replay actor-critics do: a stateful expert, such as a PID, given as
its expert_policy now works with ImitationLoss, IBRL and
LCBGatedBootstrap, which read the actions collection stored from the
expert's state; IQL refused it before. With an expert, IQL's replay also
keeps the environment's own observations and the expert flags, so its
evaluations log replay/expert_share, and an extension calling an expert
of its own reads the raw observations, not the normalised ones it was
given under normalize_observations=True.
Upgrading: IQL runs with an expert and normalize_observations=True
whose extensions call that expert change. A checkpoint of an IQL run
with an expert saved by 0.6.0 restores and resumes with its replay as
0.6.0 kept it, without the new fields.
- A refusal names the phase that needs the missing capability. An
extension acting at action on PPO, APO or REINFORCE, which run the
phase, is refused because the phase needs an off-policy update; the
message now says so: ... which needs off_policy (...) for its action
phase.
- The agents named in ImitationLoss's, ExpertValueMetrics',
CloningPretrain's, ExpertPrefill's and PriorData's docstrings and
error messages are those that run them: CrossQ, TQC, RVI-SAC, IQL, AVG
and DAgger were missing where they apply.
- Docs: the PQN comparisons against purejaxql are version 4, a
correction of their text only. The initialisation is matched (Ajax's PQN
has started as purejaxql's since before version 3 ran), and PQN-Asterix
no longer says Ajax cannot build pqn_minatar.py's network: both sides
keep pqn_gymnax.py's MLP, as its first version ran. Nothing was rerun;
the results page still reports version 3's run for PQN.
- A progress bar. On a terminal or in a notebook, train with no
logging_config draws a progress bar (tqdm) under its lines, with the
rate and the time left, which the lines then leave out. It moves as
training goes on, about a hundred times a call on a GPU and twenty on a
CPU; in a log file or CI nothing is
drawn and the lines are as before. APG's lines
keep the time left: it trains in one program, with no chunks to report.
- LoggingConfig(on_progress=...), the bar's hook: a function called
with each seed's fraction done as training goes on.
- One call to the host per evaluation. The seeds trained side by side
share each evaluation's call to the host, to log and to hand over to an
evaluation_device; JAX's own rule made one per seed, each on a GPU a
sync of the device. On bob's L40S, a 500-tick chunk of SAC on gymnax
Pendulum-v1 and its evaluation take 732 ms instead of 772 ms at 50
seeds, 173 ms instead of 180 ms at 10. on_evaluation now gets NumPy
arrays (JAX arrays before), the seeds side by side in their order.
Upgrading: an on_evaluation that uses JAX arrays' own methods
(.block_until_ready(), .at[...], .devices()) converts its metrics
with jnp.asarray first.
- Chunks and evaluations compile once per call. A train call that
evaluates as it trains compiled its chunk program and its evaluation
program twice each: the start state handed the first chunk some leaves
(an optimiser's zeros, the evaluation rows, a few Python floats) in
another layout than every later chunk returned them. All chunks now get
one layout, so each program compiles once: on bob's CPU with 2 seeds at
agent_bench's size, SAC, TD3, DQN, APO and CrossQ compile 3 programs a
call instead of 5, 2 to 3 s less. With a warm persistent compile cache
the saving is smaller. Results are bit for bit as before, but APO's.
Upgrading: APO's runs that evaluate as they train can change by rounding: its first chunk now runs the program the later ones run. - On a CPU, chunks of different lengths share one program. A run that evaluates as it trains trains in chunks between its evaluations, and each chunk length compiled a program of its own. Where the last chunk was shorter than the others, it compiled while the earlier ones trained, on the cores they trained on: at agent_bench's size PQN's chunks took 1.3 to 6 times as long then, which made PQN and UDRL look faster with the progress bar, whose pieces already shared one program. On a CPU a call whose chunks have more than one length now trains them all with one program: at that size PQN's run compiles 3 programs instead of 4 and takes 11% less time, TDMPC2's compiles 3 instead of 5. Calls whose chunks have one length, runs on a GPU and runs that draw the bar train as before.
Upgrading: a CPU call whose chunks differ in length trains in another program, which can change its results by rounding; the exact pins' 196 small runs did not change. - The progress bar on a CPU: one program a piece. With the bar, a CPU run trains each chunk in pieces with a report after each, and ran the chunk's last tick as a program of its own. Each piece now trains as a chunk does without the bar, its last tick included: at agent_bench's size PQN's chunks with the bar take 35% less time and AVG's 27%, and the calls of six of eight agents timed 5-26% less, as each compiles one training program instead of two. A one-tick chunk now traces its tick once instead of twice, as the bar's last-tick program did: without the bar, APO's and PPO's calls take 3-4% less time at that size.
Upgrading from 0.6.0¶
The changes above that can break code or results each end with an Upgrading: note. In brief:
- A GPU run of a Playground or
"mujoco:"task steps MuJoCo Warp, so its results differ from 0.6.0's. What to do: build the environment withbuild_env_from_id(env_id, n_envs=..., physics="jax")and pass it to the agent with the samen_envs, also to resume a GPU run saved under 0.6.0. A very large batch of seeds and envs can stop with an error namingphysics="jax": Warp's contact buffer has a fixed room. on_evaluationgets NumPy arrays, not JAX arrays, with the seeds trained side by side in their order. What to do: a callback that uses JAX arrays' own methods converts its metrics withjnp.asarray.- IQL with an expert keeps the raw observations and the expert flags in
its replay. Under
normalize_observations=True, an extension calling that expert now hands it raw observations, so those runs change. An IQL checkpoint saved with an expert by 0.6.0 resumes with 0.6.0's replay, without those fields. What to do: compare with runs of this version; retrain rather than resume where the expert's observations matter. - Some results move by float32 rounding, with the same algorithms:
- GPU runs:
uv.lock's CUDA 12.9 runtime and its kernels, and the off-policy updates planned before the run; - on a CPU too, runs through the SAC family's policy step (SAC with an expert, an action transform or a warm-up chooser, the warm-ups of ASAC, CrossQ and REDQ, IQL trained online);
- a process that already showed several CPU devices, whose CPU runs now
split over them (
devices=jax.devices("cpu")[:1]keeps one); - a CPU call whose chunks differ in length;
- APO's runs that evaluate as they train.
What to do: compare with runs of this version.
0.6.0¶
What a user of 0.5.0 meets:
- A first run shows itself.
trainwith nologging_confignow evaluates about ten times and prints a line each time, with the time left; a run with aLoggingConfigof yours says where it logs. The results come back by name (evaluations.returns),agent.evaluatescores a trained policy, andagent.saveandajax.loadkeep an agent with its state. - Clearer errors and warnings, after six newcomer trials: an unknown id or argument names the closest ones, Stable-Baselines3's call shapes and argument names get Ajax's answer, a state from another agent or environment is refused saying so, a run that ends inside the warm-up says it does not train, and warnings name your line.
- The README and the docs it links to were rewritten for a first-time user.
- Defaults from each agent's reference code. PPO's are ppo2's MuJoCo
run (normalisation, value clipping, TensorFlow 1's Adam, one env, 64-64
tanh layers), DQN's are CleanRL's, APO, PQN, IQL and DAgger follow their
own code, and SAC, TD3, REDQ, ASAC, TQC and RVI-SAC with
memory=build Ni et al. (2022)'s networks. Results change; "Upgrading from 0.5.0" gives the arguments that restore the earlier ones. - A new agent, REINFORCE, as Spinning Up's Vanilla Policy Gradient runs it. Ajax has twenty agents.
- Gymnasium's eleven MuJoCo tasks in JAX (
"mujoco:HalfCheetah-v5"and the others, with thegymnasium-mjxextra), and training on MuJoCo Warp on an NVIDIA GPU, about five times faster than pure JAX for SAC and PPO on an L40S. - Sweeps, devices and presets.
train(sweep=...)trains several configurations in one compiled program,train(devices=...)splits the seeds over devices, andAgent.preset(name, env_id)takes the values an agent's reference code tunes for one task (PPO.preset("SB3", env_id), Stable-Baselines3's). agent.rendersaves an episode as an animation, andtrain(precision=...)runs the networks in bfloat16.- Faster training in places, with the same maths: DreamerV3 on the GPU, REDQ, APG, TD-MPC2, UDRL and DQN on MinAtar, logged runs that evaluate between compiled chunks, and datasets loaded into the replay in one step.
- The agent benchmark has 15 agents on 19 DeepMind Control and MinAtar tasks, summed up per suite in two figures (scores, and scores against hours), and the performance page times each benchmarked agent on four CPU cores. Ajax's PPO, SAC and DQN were run beside SBX's and Stable-Baselines3's under the reproduction protocol, with no difference shown at 96 seeds a side.
- Requirements: JAX 0.10.2 or newer, and the
playgroundextra takes MuJoCo 3.7 to 3.15. Ajax ships apy.typedmarker.
The changes in full follow. "Upgrading from 0.5.0", after them, gives what to do for each change that can break code or results.
Changes since 0.5.0¶
- Deprecated:
ConditioningMetricsis nowCriticDiagnostics. The extension has a name that says what it logs: whether the critic's features are degrading (their effective rank, the fraction of dormant units, the feature and weight norms). Its metrics keep their keys (Cond/...).ConditioningMetricsstill works: importing it warns (FutureWarning) and givesCriticDiagnostics. On a replay agent it, andBiasVoreDecomposition, now read the agent's own replay:buffer=, which took the replay of a second agent built with the same settings, is needed no more. Upgrade: rename the import; dropbuffer=unless it names another replay. - Docs: the README was rewritten for a first-time user: install, a first run that acts and saves, the Stable-Baselines3 page, and a sweep of seeds and learning rates in a few lines. Every page it links to was shortened and checked against the code (names, defaults, outputs), and wide tables keep names on one line.
- Docs: the agent benchmark at a glance. The benchmark page opens with
two figures per suite: the interquartile mean of the normalised final
returns beside the performance profile, as rliable draws them, and that
mean through training against the hours four CPU cores take. The
performance page's table of speeds comes from a timing pass of every
benchmarked agent (
benchmarks/suite/results/timing-0.6). - Progress lines give the time left. From a run's second evaluation, each
line
trainprints ends with the call's time left, at the pace of the last interval between two evaluations. - A run with a
LoggingConfigof yours prints one line when it starts: how often it evaluates and where it logs. It printed nothing untiltrainreturned. - A call that ends before the first update warns. An off-policy call
ending before
learning_startssteps collected trains nothing; it now says so. - Stable-Baselines3's call shapes get Ajax's answer.
PPO("MlpPolicy", env)says Ajax takes the environment alone;agent.predict(obs)andagent.save(path)say the trained state comes first; a Gymnasium environment object, or an id without its prefix, names thegymnasium:form; SB3's own argument names (verbose,net_arch,policy_kwargs,tensorboard_log,seed,device,progress_bar) say where Ajax takes each, and the others point to the SB3 page instead of a misleading spelling match. - Warnings name your line, not Ajax's (the Gymnasium and whole-rollouts warnings did), and a script that logs without a main guard is told so without a traceback before the message.
- Docs: the SB3 page says
predictreturns the action alone, as a JAX array (a Gymnasium environment takes it throughnp.asarray), and thatloadreturns the agent and its state; the quickstart renders 100 steps and prints where the GIF went; installing the TensorBoard viewer; the warm-up defaults in the training guide. agent.renderno longer floods the output with ALSA errors on a machine without a sound card: Gymnasium's classic-control drawings start pygame, which opened an audio device every frame. SDL now gets its dummy audio driver while an episode is drawn, unlessSDL_AUDIODRIVERis set.- Ajax ships a
py.typedmarker (PEP 561), so mypy and pyright check calls into Ajax against its annotations. - Changes results: an agent's actions on
mujoco:InvertedPendulum-v5andmujoco:Pusher-v5now span Gymnasium's action space. Agents act in [-1, 1], and onmujoco:tasks that went to the motors unscaled. InvertedPendulum's motor takes ±3 and Pusher's take ±2, so agents reached a third and a half of the range, and Pusher's control cost a quarter of Gymnasium's largest. gymnasium-mjx's adapter, which now holds themujoco:tasks, maps [-1, 1] onto each motor's range, as Ajax does forgymnasium:tasks; the Humanoids' motors take ±0.4. The other six tasks, whose motors take ±1, are unchanged, as are Playground's own environments. Upgrade: results recorded on those two tasks before this change are not comparable. - Ajax needs JAX 0.10.2 or newer (was 0.10.0). Before 0.10.2, JAX's
CPU backend kept a pinned_host placement in device memory, so DreamerV3's
latents kept on the host stayed on the device. Upgrade:
pip install -U "jax>=0.10.2"(or"jax[cuda]>=0.10.2"). - The
playgroundextra needs MuJoCo 3.7 or newer (was 3.6). MJX 3.6 passesa_mintojnp.clip, which JAX 0.10, Ajax's floor, no longer accepts, so"mujoco:"and Playground tasks failed withclip() got an unexpected keyword argument 'a_min'on an install at the floors. - New:
REINFORCE, the plain policy gradient (Williams, 1992), as Spinning Up's Vanilla Policy Gradient runs it: one full-batch policy step per rollout on GAE advantages of a learned baseline, then 80 critic steps.baseline=Falseweights each step by its reward-to-go alone, andREINFORCE.preset("rtg_pg", env_id)is Spinning Up's plain example. Discrete and continuous actions; no memory yet. See REINFORCE. PPO's GAE moved toajax.agents.returns.compute_gae, which PPO, APO and REINFORCE share; it was private (_compute_gae), so no public name changed. - New:
agent.render(state, path)saves an episode of the trained policy as an animation: a GIF on the gymnax tasks gymnax draws, on MuJoCo Playground and on themujoco:tasks, an interactive page on Brax (Train, evaluate, deploy, "Watch the policy"). The newrenderextra installs what the gymnax drawings need: matplotlib and Gymnasium's classic-control drawings. - New:
ajax.wrappers.ObservationWrapper, a base class whoseobservation(obs)changes every observation, the one an episode's end leaves in the info included. A wrapper changing only whatresetandstepreturn trained on two kinds of observations, with no error (Environments, "Changing the observations"). The memory guide trains on a CartPole with hidden velocities built with it. - An architecture of widths alone warns.
actor_architecture=[64, 64](SB3'snet_archhabit) built layers with no activation between them, with no word; the agent now warns and shows the tuple to write. agent.evaluate,predict,policyandsavename the argument meant, asrenderandtrain_offlinedo.- A state from another agent or environment is refused saying so.
evaluate,predictandrendergave flax's error about a parameter's shape; they now say the state acts with the agent and environment that trained it. - A
LoggingConfigwhoselog_frequencyis past the run's end warns. Its default is 10,000 steps, so a shorter run with aLoggingConfigof your own returned no evaluation, with no word. - The warning for a budget that is not whole iterations no longer says the missing evaluation is NaN: the evaluations returned have no column for it.
- Docs: "Coming from Stable-Baselines3" says whose defaults Ajax keeps
(each algorithm's original) and lists, for PPO, SAC, TD3 and DQN, where
SB3's differ. The tables of default
n_envsand default networks had drifted from the code for PPO, APO, PQN, DQN and others; tests now hold them to it. - Fixed: a logged run with
JSRLCurriculumwarnedinvalid value encountered in cast. The steps without an evaluation held NaN in place of JSRL's integer stage. No logged value changes. agent.renderandagent.train_offlinename the argument meant. A keyword neither takes is refused in the agent's name with the closest names (PPO.render has no argument 'max_step'. Did you mean max_steps?), and a call without the state says what the method needs.- New:
PPO.preset("SB3", env_id), Stable-Baselines3's PPO defaults in Ajax's names, for settings brought from SB3 or SBX. Ajax's PPO defaults are ppo2's, which clip the value loss and normalise observations and rewards; SB3 and SBX do neither. The PPO page lists the differences ("Presets"). - Ajax's PPO and SAC were run beside SBX, Stable-Baselines3's JAX version (0.28.0), under the reproduction protocol. Both are similar by the registered margin, with no difference shown at 96 seeds a side (Reproduction, "Results"). A first PPO run left Ajax's value-loss clip on, which SBX does not have, and ended lower (489.4 against 500); the comparison's second version turns it off. The PPO comparison with Stable-Baselines3 was run again with the same setting written out (version 3), since its earlier record predates the clip being PPO's default.
- Ajax's DQN was run beside Stable-Baselines3's on CartPole-v1 under the reproduction protocol, set up as SB3's (Huber loss, one update per step). No difference is shown at 96 seeds a side (243.7 against 245.9), and the verdict is inconclusive: both end near half of the task's 500 and vary from seed to seed, so the interval is wider than the ±25 margin (Reproduction, "Results"). The run does not cover DQN's own defaults.
agent.renderdraws Gymnasium environments and your own. Agymnasium:environment is saved as a GIF of its own pictures. Any other environment takesagent.render(state, path, draw=my_draw), wheremy_draw(env_state)returns one picture. Both were refused before.- Sweeps on every agent of the shared loop.
train(sweep=...)now varies numbers on APO, ASAC, AVG, CrossQ, DAgger, DQN, IQL, PQN, REDQ, RVI-SAC, TD3, TQC and UDRL as on SAC and PPO;agent.sweepable_fields()lists each agent's. A class declares the fields it defines (sweepable), a mixin its own, and an agent takes the union, less those it refuses with a reason (unsweepable). One test checks every declared field of every agent against separate runs, and against a sweep of the agent built with the value: CrossQ's sweep rounds apart from a separate run too soon for the first comparison. Not yet: the world models and APG, and fields whose optimiser or schedule is built with the agent (DQN's and CrossQ'slearning_rate, the exploration'sepsilon_decay_frac). - The seed axis is said where it is read. Results keep their seed axis
whatever the number of seeds. The last line
trainprints now givesevaluations.returns' layout and shape,print(evaluations)opens on it, and the quickstart and the training page show a single seed's curve asevaluations.returns[0]. - Checks and messages, after a fifth newcomer trial:
- a script that trains at its top level with a logging backend used to lose its logs silently (the logging process failed on importing the script): the run now warns that the logs are missing, and both messages say to guard the entry point;
trainrefuses a seed that is no integer (seed=1.5gave "'float' object is not iterable"), a negativen_timesteps(it trained one rollout) andnum_episode_test=0(it returned NaN);LoggingConfigrefuses alog_frequencybelow 1 (it returned no evaluation);- a
total_timestepsbelow the call's steps says thatn_timestepsis what the call trains; evaluate,render,predictandpolicyrefuse an integer orNonegiven as the state, showing the call;- docs: where a one-network agent keeps its network and how to print an agent's network shapes, a resumed call's new run ids, the agents for image observations, and DQN's optimiser on the page for people coming from SB3.
- DQN's default optimiser and loss on vector observations are CleanRL's
(default change): Adam at eps
1e-8and the squared error, as thedqn.pyits other defaults come from. They were the authors' centered RMSProp and Huber loss, which the authors run on Atari's clipped rewards: with them the default did not learn CartPole-v1 (a return near 10 after 500,000 steps on four seeds, where CleanRL's code and the new default reach 500). On image observations (cnn_image_shape) the authors' optimiser and loss stay. To keep the earlier loss, passtd_loss_fn=compute_huber_1_td_loss(ajax.agents.critics). - More checks, after a third newcomer trial:
- an expert whose action drops its last axis is refused where Ajax first calls it, naming the expert and the axis (before, a broadcasting error, or a silent broadcast);
LoggingConfig(backends=TensorBoardBackend(...)), without the tuple, shows the tuple to write;trainrefuses a keyword it does not take before anything starts, naming the one meant (logging:logging_config);- a dataset whose rows do not fit the agent's environment says so, and a gymnax environment with a step of its own (bsuite's DeepSea) names the two lines that build it;
- the docs give each expert piece's module, how to
recorda trained agent's policy, what the seeds of a resuming call do, and whatrenderneeds for MinAtar (nothing) and Brax (the internet).
- Clearer errors and checks, after a second newcomer trial:
- an unknown environment id names the closest ids, and an unknown agent
argument the closest arguments (
learning_rate:actor_learning_rate,critic_learning_rate); - an agent on the wrong kind of actions names the agents that fit;
- a
mujoco:id without MuJoCo names theplaygroundextra, and a Gymnasium environment outside thegymnasiumextra (LunarLander's Box2D) no longer points at that extra; predictchecks the observation's shape,policyandpredictrefuse aseed_indexthe state does not hold (it returned an action before),policy.actrefuses an observation without a row per environment, andevaluate,policyandpredictsay so when given train's evaluations instead of its state;- image observations read by an MLP warn and name the
cnn_image_shapeto pass, and one in another order than the environment's (channels first) raises; - a budget below one rollout warns that no evaluation is recorded.
- an unknown environment id names the closest ids, and an unknown agent
argument the closest arguments (
- Docs: where each source lists its environment ids, a hand-written loop for one environment with a recurrent policy, and PPO's rollout count corrected (Training).
- New: a sweep reads by configuration. A sweep's default progress
shows a line per configuration under each evaluation, and
agent.by_configuration(evaluations.returns)gives each configuration with its rows, one per seed. - New:
print(agent)shows the call that builds it, with the arguments that differ from their defaults. - Docs: writing your own environment has its own example
(Environments), which says that gymnax applies the time limit:
step_envreturns the termination only. The sweep, save and load, TensorBoard and hand-written loop pages are corrected after a newcomer trial. -
New:
train(precision=...)runs the networks in bfloat16. Mixed precision: parameters, gradients and optimiser stay float32, the layers compute in bfloat16, every network returns float32."auto"uses bfloat16 only where every device has bfloat16 units (NVIDIA compute capability 8.0 or more, TPU) and float32 elsewhere;"bfloat16"forces it;None(the default) is each agent's original precision, float32 for all for now, so nothing changes unless asked. The run config records the result. DreamerV3, whose original computes in bfloat16, stores its replay latents in the compute dtype: half the replay, without loss (docs/guide/performance.md, "bfloat16"). -
Changed: a resume holds no second copy of a large replay. A checkpoint now stores its arrays of 16 MiB or more after the pickle stream, and a restore copies each from the file straight to where the state keeps it (a 10-seed DreamerV3 replay in host memory: 80 GiB, held once instead of up to three times).
load_checkpointandloadno longer keep the file's state while restoring it. Checkpoints written before still load. Upgrade note: a checkpoint holding such an array is no longer one pickle stream: read it withrestore_into,load_checkpointorload, notpickle.load, and an older Ajax cannot read it. -
Fixed: a forced reset kept the reward normaliser's running return. With
normalize_rewardsand forced resets (num_resets_per_eval), the abandoned episodes' discounted return carried into the new episodes' rewards and statistics. It now restarts at zero, as SB3'sVecNormalize.resetdoes; the statistics stay. -
Deprecated:
LoggingConfig(sweep=...)is nowevaluate_last_fifth_only. The flag evaluates only in the last fifth of training; its name was also that oftrain(sweep=...), which trains several configurations in one program.sweep=Trueis still accepted: it warns (FutureWarning), sets the new field and readsFalseafterwards. Upgrade: rename the argument, and readevaluate_last_fifth_only. -
DQN's Atari preset holds epsilon at 1 during the warm-up. Mnih et al.'s code starts the decay after its 50,000 warm-up steps and ends it a million steps later (google-deepmind/dqn@9d9b1d1,
NeuralQLearner.lua:369-371); the preset decayed from step 0 to the same end, so its epsilon was up to 0.043 lower in between. DQN gainsepsilon_decay_start(0 by default: other runs are unchanged), which the preset sets to 50,000 withepsilon_decay_frac=0.02. Upgrade: for the earlier schedule, passepsilon_decay_start=0, epsilon_decay_frac=0.021toDQN.preset("Atari", ...). -
Fixed: n-step rewards were clipped after the sum. With
n_stepabove 1 andnormalize_rewards, each reward of a row is now divided and clipped at 10 before the discounted sum, as collection clips it and as SB3'sNStepReplayBufferdoes. Results change only where a normalised reward exceeds the clip. -
agent.policy'sactrefuses a missing reward after an episode's first step. A policy that reads the last reward (PreviousReward, on by default withmemoryon SAC, TD3, REDQ, ASAC, TQC and RVI-SAC; UDRL) read zero whenactwas given neitherdonenorreward. Upgrade: passdoneandrewardto everyactafter the first. -
Fixed:
PreviousRewardread the normalised reward in training. Withnormalize_rewards, collection appended the normalised reward where an evaluation andagent.policyappend the environment's own, about 35 times apart on Pendulum. Collection now appends the environment's own. Recurrent SAC, TD3, REDQ, ASAC, TQC and RVI-SAC add the feature by default, so their results withnormalize_rewardschange. -
Fixed:
CloningPretrainmade APO and AVG normalise observations twice. APO withnormalize_observationsand AVG store normalised observations; cloning also put the dataset's statistics on their networks, which normalised them again, and droppedobservation_clip. Their results withCloningPretrainchange. -
PPO clips its value loss, as ppo2 does. Each squared value error is the larger of its own and that of the value clipped to
clip_rangearound the value the rollout was collected with (Baselines' ppo2,model.py:66-75; PureJaxRL's recurrent PPO does the same). The newclip_value_lossturns it off; by default (None) PPO clips, except withunroll_length, Brax's PPO, which does not. PPO's results change. Upgrade: passclip_value_loss=Falsefor the old loss. -
PPO steps TensorFlow 1's Adam, as ppo2 does. ppo2's
tf.train.AdamOptimizeradds epsilon to the square root of the second moment before the bias correction; optax's Adam adds it after, an epsilon 32 times smaller at the first step and about the same after a few thousand. The new update rule"tf1_adam"(OptimizerConfig,ajax.networks.utils.scale_by_tf1_adam) is PPO's; withmemoryorunroll_lengthPPO keeps optax's Adam, as PureJaxRL and Brax use it. PPO's results change. Upgrade: no option restores optax's Adam on feedforward PPO; compare with runs of this version. -
PreviousAction()appends the action executed before each observation (ajax.extensions.observe): zero at an episode's first observation, in agent units, a discrete action one-hot, never normalised. Collection stores it, and evaluation andagent.policyappend it as collection does, so an actor with memory can read its own past actions, as Ni et al. (2022)'s recurrent actor does; a recurrent Q-critic then reads it from the observation instead of appending its own. It is opt-in: default runs do not change. Observation features read the action throughObserveInputs.previous_action. PreviousReward()appends the reward paid for the action executed before each observation (ajax.extensions.observe), raw, zero at an episode's first observation, as Ni et al.'s recurrent networks read it. Collection stores it, evaluation appends it, andagent.policy'sactreads the reward it is given (it refusesdonewithoutreward). Features read it throughObserveInputs.previous_reward. APG refuses it: its closed-loop rollout passes the features no reward yet.- Breaking: SAC, TD3, REDQ, ASAC, TQC and RVI-SAC with
memory=build Ni et al. (2022)'s recurrent networks (twni2016/pomdp-baselines, the owner's reference for them; TQC and RVI-SAC by analogy). The memory reads the previous action, the previous reward and the observation through embeddings of 16, 16 and 32 units; a run with memory addsPreviousAction()andPreviousReward()where its extensions hold neither, soagent.policy'sactneeds each reward. The memory is 128 units wide and starts as Ni et al.'s unless theMemoryConfigsets them. The networks' layers run after the memory, on its output joined with a shortcut embedding of the observation (the critic's with the action asked about), and the critics read one memory. Every layer starts as Ni et al.'s.NetworkConfiggainsinput_embedding,shortcut_widths,embedding_kernel_initandcritics_share_encoder;MemoryConfig.hidden_sizedefaults toNone, the agent's reference width (64 where an agent has none, as before). Upgrade: a checkpoint of one of these agents trained with memory does not restore into this version: its parameters are another network's. Retrain, or pin the previous version to use it. - Breaking: their replay takes Ni et al.'s windows:
burn_in=0(was 8),sequence_length=64(was 16) and, with memory,batch_size=64windows (was 256).batch_sizenow defaults toNone: 256 rows without memory, as before. A window's first row reads no previous action or reward (Ni et al.'sa[0] = r[0] = 0), unless the window starts from a stored memory. Upgrade: passburn_in=8, sequence_length=16, batch_size=256to train as before. - Recurrent TD3 is Ni et al.'s: its actor maximises min(Q1, Q2), and
policy_delaydefaults toNone, 2 without memory as before and 1 with it; with memory, TD3's and REDQ's critics read the agent's [-1, 1] actions, not the env's units. Results with memory change. Upgrade: passpolicy_delay=2for the delayed actor; the critics' action units have no option. - Recurrent SAC's numerics are Ni et al.'s: with memory, the squashed log-density subtracts log(1 − tanh² + 1e-6) (also TQC's and RVI-SAC's; REDQ's and ASAC's already did), the critics' squared errors are summed, and the temperature steps alpha on the actor loss's own log-densities. Results with memory change, and no option restores the earlier numerics.
-
SAC, TD3, REDQ, TQC, ASAC and RVI-SAC can share a memory. With
share_encoder=True,memory=andPreviousAction(), the critic's encoder and memory block read the observation and the previous action for both networks, as Ni et al.'s shared recurrent network does; the action the critic is asked about joins after the memory. The critic's loss trains it and the actor reads it without a gradient. WithoutPreviousAction()the agent refuses a shared memory. -
Three defaults now come from the agents' reference code. An audit of every agent's defaults against its original code found these without a source:
- SAC's actor and temperature step from the first update, as
softlearning's do;
policy_update_startandalpha_update_startwere 2,000. Default runs do not change (the warm-up is 10,000 steps); runs with a shorterlearning_startsdo. Upgrade: pass both at 2,000 for the old behaviour. - REDQ warms up for 5,000 steps (
learning_starts), its official code'sstart_steps, not 10,000. Upgrade: passlearning_starts=10_000. -
DAgger's expert share falls linearly from 1 to 0 over 15 iterations, the reference code's
LinearBetaSchedule(15).beta_decaybecomesbeta_schedule:LinearBetaSchedule(rampdown_rounds)orExponentialBetaSchedule(decay), both inajax.agents.DAgger.DAgger. Upgrade:beta_decay=dbecomesbeta_schedule=ExponentialBetaSchedule(d); the old default wasExponentialBetaSchedule(0.0). -
DAgger fits its policy as its reference code does. At the end of each iteration of
iteration_stepssteps, it trains for 4 epochs over every state the replay holds, in shuffled minibatches of 32 (HumanCompatibleAI/imitation'sDAggerTrainer); before, it took one gradient step per environment step. Its policy is a Gaussian with one learned standard deviation per action dimension (categorical for discrete actions), fitted by likelihood with an entropy bonus of weight 1e-3, and it acts by sampling; before, it was deterministic and fitted by squared error. This changes results. The newfitargument picks the fit:IterationFit(epochs=4, entropy_weight=1e-3), the default, orOnlineFit(), the earlier one; both are inajax.agents.DAgger.DAgger. DAgger takes notrain_frequency: its fit sets it. Upgrade: passfit=OnlineFit()for the old behaviour, and to restore a DAgger checkpoint saved before this release. -
normalize_rewardsdivides by the discounted return's spread and clips, as SB3'sVecNormalizedoes. It divided each reward by the running standard deviation of the single-step reward, which is 0 for a constant reward (CartPole, MountainCar, Acrobot): every reward became ±10,000, and recurrent PPO with normalised rewards failed masked CartPole.reward_normalization_gammanow defaults to the agent'sgamma(0.99 for APO, ASAC and RVI-SAC), and normalised rewards are clipped to ±10, at collection, at replay sampling and in evaluation. This changes results for runs withnormalize_rewards=True. Upgrade: passreward_normalization_gamma=0to divide by the single-step reward's standard deviation again (now clipped). - PPO normalises observations and returns by default, as ppo2's MuJoCo
run wraps its env in
VecNormalize:normalize_observations=True,normalize_rewards=True(the return's spread, withgamma, clipped at 10) and the newobservation_clip=10.0, which on-policy agents take (replay agents refuse it). This changes PPO's results. A sweep no longer variesgammawhile the reward normaliser discounts with it; setreward_normalization_gammato sweep it. Upgrade: passnormalize_observations=False, normalize_rewards=Falsefor the old behaviour. - PPO's defaults are ppo2's MuJoCo run: one env (was 4) and 64-64 tanh
layers (was 128-128), so 2048 steps make ppo2's 32 minibatches of 64.
This changes results. Upgrade: pass
n_envs=4, actor_architecture=("128", "tanh", "128", "tanh"), critic_architecture=("128", "tanh", "128", "tanh"). - APG's in-context controller, IQL and PQN follow their reference code.
APG.contextual_controllerbuilds the reference's transformer layers: no bias outside the input embedding, LayerNorm epsilon 1e-5, and an MLP four times as wide (buswayne/in-context-controller,--bias False).MemoryConfiggainsbias,layer_norm_epsilonandmlp_ratio, whose defaults keep every other memory unchanged. Upgrade: a controller saved before restores withbias=True, layer_norm_epsilon=1e-6, mlp_ratio=2.- IQL's actor learning rate decays to 0 by a cosine over the run's
updates, its reference Learner's default
(
actor_learning_rate_decay="cosine"). A run split into calls passes its whole horizon (total_timesteps) to each. Upgrade:actor_learning_rate_decay=Nonekeeps the rate constant, as the reference's fine-tuning config does; pass it to fine-tune a state trained offline. -
PQN's defaults are purejaxql's MinAtar config: 128 envs of 32 steps, 2 epochs of 32 minibatches, RAdam at 5e-4 decayed linearly over the run (
learning_rate_decay="linear"), epsilon decaying over the first 10% of the run. Upgrade:n_envs=8, n_steps=128, n_epochs=4, num_minibatches=4, learning_rate=2.5e-4, learning_rate_decay=None, epsilon_decay_frac=0.5. -
DQN's defaults are CleanRL's
dqn.py(cleanrlfe8d8a0), its vector-observation reference: a 120-84 ReLU network (was 128-128), a replay of 10,000 (was 100,000), batches of 128 (was 64), 10,000 warm-up steps (was 1,000), one update every 10 environment steps (was every iteration) and a target refresh every 50 updates (was 500), CleanRL's 500 environment steps. The authors' centered RMSProp and Huber loss stay. This changes results. Upgrade: passarchitecture=("128", "relu", "128", "relu"), buffer_size=100_000, batch_size=64, learning_starts=1_000, train_frequency=1, target_update_interval=500for the old behaviour. -
Replay agents take
train_frequency, SB3'strain_freq: fromlearning_starts, an update each time the steps collected reach a multiple of it. The default, 1, updates every iteration, as before, on every agent but DQN. An evaluation between two updates logs the last one's training metrics. -
APO's defaults are its reference code's MuJoCo config (xtma/apo,
mujoco_appo.py): rollouts of 10 envs x 200 steps (was 4 x 2,048), 20 minibatches per epoch (num_minibatches=20; was cut bybatch_size), advantages not normalised (was normalised) andnu=1.0(was 0.1). This changes results. A rollout'sn_steps * n_envsmust now be a multiple ofnum_minibatches;num_minibatches=0cuts it bybatch_sizeas before. To reproduce earlier runs, passn_envs=4, n_steps=2048, num_minibatches=0, batch_size=64, normalize_advantage=True, nu=0.1. The benchmark's APO entry runs 500 such rollouts, evaluated every 20,000 steps, as the reference. - Per-task presets.
Agent.preset(name, env_id, **overrides)builds an agent with the values its reference code tunes for one task, named after the task ("Hopper", "AntMaze", "Atari") rather than an env id; the arguments given win, and the run config records the name under"preset". Each agent module keeps its presets, with their sources, in aPRESETStable: ASAC's ten Gymnasium MuJoCo tasks, TQC's and REDQ's five MuJoCo tasks, CrossQ's Swimmer, IQL's AntMaze, TD3's D4RL (TD3+BC), PPO's, PQN's and DQN's Atari, PQN's CartPole, and DreamerV3's DMC, whose values the world-model paper protocol now reads. No default changes. - Hyperparameter sweeps in one program.
agent.train(seed=..., sweep={"actor_learning_rate": [1e-4, 3e-4]})trains several configurations, each with every seed, in one compiled program, as PureJaxRL does by vmapping over hyperparameters. Each member trains as a separate run of its configuration would, up to floating-point rounding, andagent.memberslists the seed and values of each leading row. SAC and PPO declare which fields can vary (their learning rates,gammaand the like); other agents, and settings that change shapes, are refused. To allow it, PPO's GAE no longer takesgammaandgae_lambdaas static jit arguments; results are unchanged. - DreamerV3 can keep its replay latents in host memory. With
replay_on_host=True, the posterior latents stored with each replay row (about 99% of the replay's bytes: 8 GB per seed for 2^20 rows at 12M) stay in pinned host memory, inside the training state, so that more seeds fit on one accelerator, or a run fits on a busy one. Results are bitwise those of the default; each update is a little slower. A checkpoint restores each array into the memory its skeleton keeps it in, so a resumed run keeps the latents on the host. - The actor and the critic can share their encoder; image PPO now does
by default. PPO, APO, SAC, TD3, REDQ, TQC, ASAC, RVI-SAC, AVG and IQL
take
share_encoder. WithTruethe two networks read the observations through one encoder (the hidden layers or the CNN, and with PPO or APO the memory block). The critic owns it, and the actor reads a copy refreshed after every update. PPO and APO train it with both losses, as ppo2's one network; the off-policy agents with the critic's loss alone, the actor reading it without a gradient, as SAC-AE and DrQ do; their encoder isactor_architecture, and the critic'scritic_architecturelayers read its features with the action.None, the default, follows each agent's reference code: PPO shares its CNN, as ppo2 and CleanRL do on Atari; every other network stays apart, as before. This changes the results of PPO withcnn_image_shape. - Upgrade: to resume an image PPO checkpoint saved before, or to
keep the earlier networks, pass
share_encoder=False. - Recurrent PPO's heads each read the memory through a layer of their
own, as PureJaxRL's recurrent PPO does (
ppo_rnn.py: a Dense(128) and a ReLU per head, orthogonal with gain 2). The newNetworkConfig.head_architecturegives any agent's networks such hidden layers after the encoder and the memory block, andhead_kernel_inittheir initialiser. This changes the results of PPO withmemory. Its actor and critic keep separate memories: a shared one fails the memory probe, even with these layers. - Upgrade: to resume a recurrent PPO checkpoint saved before, or to
keep the earlier networks, set
agent.network_args = agent.network_args.replace(head_architecture=()). - DreamerV3 trains faster on the GPU. The world model's gradient through its 64 filtering steps now takes each RSSM weight's gradient once per update, as one product over all steps, instead of adding 64 small per-step products. Results are the same up to floating-point rounding. On a shared L40S (MuJoCo Warp Hopper), an update took 6-10% less time at 1 and 2 seeds; it has not been timed on a machine with no other job. It uses about 0.2 GB more GPU memory per seed, and the CPU bench's DreamerV3 run is about 6% slower.
- The
playgroundextra allows MuJoCo up to 3.15. It heldmujocoandmujoco-mjxbelow 3.10 for one bug: Playground 0.2 compares MuJoCo versions as strings, so itsReacherEasyandReacherHardfailed on 3.10 and later with'MjSpec' object has no attribute 'find_body'. As a deliberate workaround, Ajax now gives Playground's Reacher builder upstream's fix (Playground commit 33f1b284), only while the installed Playground still compares strings; it goes once a Playground 0.x release holds that commit. Every Playground task, Reacher included, takes MuJoCo 3.6 to 3.15 (MuJoCo Warp computes contact forces from 3.14). - MEW temperature annealing.
MEW()(Adamczyk et al., 2026) lowers the temperature of a maximum-entropy agent (SAC, ASAC, AVG, CrossQ, REDQ, RVI-SAC, TQC) at a pace set by how much its recent rewards vary, in place of the agent's own temperature rule. It is opt-in: no agent's default changes. Other agents refuse it, naming theentropy_temperaturecapability they lack. - Logged runs evaluate between training chunks. With a
LoggingConfig, training runs up to each evaluation as one compiled chunk, and the evaluation runs between chunks as a program of its own, as Brax does. Before, the evaluation sat inside every training step, which slowed the steps between evaluations too. Evaluations come at the same steps as before, with the same results up to floating-point rounding. On MuJoCo Warp (L40S, 10 seeds), a million-step run evaluated every 10,000 steps took 4% less time with SAC and 1% less with PPO. - Faster REDQ, and SAC without its unneeded gates. REDQ evaluates only the 2 target critics its target draws, as its official code does (Ajax evaluated all 10), and its 20 critic steps no longer copy every critic at each step. SAC no longer checks its 2,000-step actor and temperature starts at every update when, as by default, its updates start later. Results are the same up to floating-point rounding. At 10 seeds on a GTX 1080 Ti, REDQ took 20% less time and SAC 5% less; REDQ took 10% less on a CPU.
- Datasets load into the replay in one step.
train_offline,PriorDataand retained data used to write a dataset into the replay one row per env at a time, which took about 20 s per million rows on a GPU. They now write it at once, with the same result. IQL's offline run on a million rows (1080 Ti, 2,000 updates) went from 17 s to 3 s.fill_replay(buffer_state, data)andseed_replay(agent_state, data, env_args)no longer take the replay's buffer: drop that argument. - Evaluation on another device.
LoggingConfig(evaluation_device=...)scores each evaluation in a thread on that device, a second GPU or the CPU, while training goes on. The scores are those of the evaluation in place, and they reach the backends under their own timestep. It is opt-in: by default training still waits for each evaluation. - Training on MuJoCo Warp. On an NVIDIA GPU, agents now train on
Playground tasks and the
"mujoco:"tasks built withbuild_env_from_id(..., physics="warp"), about five times faster than on pure JAX for SAC and PPO on an L40S. Every online continuous-action agent was checked. Before, every agent failed on its first step: the auto-reset merged each physics array env by env, and Warp keeps its contact buffer for the whole batch of environments. That buffer now passes through the reset. Warp refuses a MuJoCo before 3.13 (the first whose Warp reports the convex collisions it drops), a CPU,differentiable_reset=Trueand APG, saying why. Pure-JAX runs are unchanged. - Warp's contact room. MuJoCo Warp keeps one contact buffer for all the
worlds a run steps at once (seeds times envs). The
"mujoco:"tasks left it at MuJoCo Warp's default, 48 contacts in all, which 47 Hopper worlds overflowed, and Warp then drops contacts with only a printed warning. They now give it 49,152 (1,024 worlds of 48), and a Warp step that runs out of contact or constraint room stops the run with an error. - Warp's convex-collision room. MuJoCo Warp sizes the buffer of its
convex (GJK/EPA) collisions like the contact buffer unless told, and each
physics call allocates scratch for every slot: 320 MB on
"mujoco:Pusher-v5". Each CUDA graph Warp captures of a call reserves its own addresses for that scratch, and on an 11 GB GPU, after about 76 graphs (a few PPO evaluations on Pusher), new ones failed with an out-of-memory error while under 1.4 GB was in use. The"mujoco:"tasks now give the buffer a slot for each of their geom pairs in 1,024 worlds (47 MB of scratch on Pusher), and a step that drops convex collisions stops the run with an error. - Gymnasium's MuJoCo tasks in JAX.
"mujoco:HalfCheetah-v5","mujoco:Hopper-v5","mujoco:Walker2d-v5","mujoco:Swimmer-v5","mujoco:Reacher-v5","mujoco:Pusher-v5","mujoco:InvertedPendulum-v5"and"mujoco:InvertedDoublePendulum-v5"run Gymnasium's own models and rules on MJX, inside the compiled program, and so do"mujoco:Ant-v5","mujoco:Humanoid-v5"and"mujoco:HumanoidStandup-v5". The tasks come from the gymnasium-mjx package, installed by the newgymnasium-mjxextra; without it, a"mujoco:"id raises an ImportError naming the extra. Upgrade, for code written against main since 0.5 (no release held these tasks): installajax-rl[gymnasium-mjx], as theplaygroundextra alone no longer brings them, and importgymnasium_mjxwhere you importedajax.environments.mujoco, which is gone. The ids are unchanged. A mujoco_playground env object, such as gymnasium-mjx'sPlaygroundTask(gymnasium_mjx.make("Hopper-v5")), can be given to an agent in place of an id; it trains and evaluates the same way. - Agent benchmark filled in. SAC, TD3, RVI-SAC and ASAC now have scores on all fifteen DeepMind Control tasks, APO's HumanoidWalk run finished, and REDQ, TQC, CrossQ, TD-MPC2 and DreamerV3 have CheetahRun scores, from runs on a GPU (Agent benchmark).
- Agent benchmark rerun at the new defaults. PPO, APO, DQN, PQN and
REDQ were rerun at
2ef57fe; the page lists what moved (PPO on CheetahRun 215 to 497, PQN on Breakout 24 to 71, DQN on Breakout 84 to 50; REDQ on CheetahRun stays at about 910). The other agents' rows are from the earlier commits (Agent benchmark). - Agent benchmark page in tabs. One tab per suite, each with its table, a
heatmap and learning curves.
benchmarks/suite/publish.pywrites the tables, figures and the README summary from the records, and a test checks they still match. - Adam keeps its moments as one vector per optimiser. Each agent's Adam
runs on the gradients joined into one vector; weight decay, the learning
rate and gradient clipping stay per array. The maths is unchanged: float32
results move by an ulp or two. On an L40S, agents ran 6% to 17% faster;
on a Mac's CPU, IQL runs about 17% slower. A checkpoint saved with one
moment per array restores: its moments are joined on load.
ajax.networks.utils.map_optimizer_moments(opt_state, params, edit)edits moments in either layout. Upgrade: code readingopt_statemoments by the parameters' tree callsmap_optimizer_momentsinstead. - Three ways to keep an expert and change what is around it
(
ajax.extensions.structure), all off unless asked for:OuterLoopReference(target_channels, max_change)has the policy move the target the unchanged expert reads (Arroyo and Giraldo, 2020);GainScheduledLaw(expert, obs_width)underExpertGains(max_factor=...)has it set a rate-limited multiplier per gain (Bloor et al., 2024); andBumplessTracking(reading_channels)has the expert's memory follow the action applied (Hanus et al., 1987). APG and UDRL refuse tracking. - A final evaluation and a step ledger.
ajax.log.final_evaluationscores a run's seeds on fixed episode sets, keyed by the task and the seed number, so every arm and the expert meet the same episodes; it returns per-episode costs and trip counts.ajax.ledgercounts every environment step of a run against one budget, pretraining included:online_steps(agent, budget)gives then_timestepsthat spends it exactly. - AdaStop compares paired runs.
AdaStop(..., paired=True)andcompare(..., paired=True)test the differences between same-numbered seeds, for runs whose seedishares something across agents, such as its evaluation episodes. The default test is unchanged. - Runs at any sensor noise level, and a measured reward. Evaluation and
UDRL read the expert's observation under the run's params, not the env's
defaults.
MeasuredRewardWrapper(env)trains on the env'sinfo["measured_reward"]; evaluation still reports the true reward. - TD-MPC2 evaluates at multiples of
log_frequency. Its evaluations drifted from the env steps (65,535, 98,302, ...) and a long call returned one empty row. They now land on exact multiples, one row each, so its evaluation numbers shift slightly; training is unchanged. - Faster APG, TD-MPC2, UDRL and DQN on MinAtar, with the same maths.
APG's transformer controller caches its keys and values during a rollout
(
MemoryCell(..., cache_keys_values=True), off for every other agent). TD-MPC2's planner rolls its policy-prior candidates out once per decision, not once per iteration (12% less time per decision on an L40S; results move by rounding). UDRL's episode-stream scan is unrolled (54% faster on MinAtar on a GPU, same bits). DQN's replay keeps MinAtar's 0/1 observations in a byte, a quarter of the memory, and reads them back as the same float32. - PORL.
porl(CloningPretrain(expert))gives SAC's keyword arguments for Xiao et al. (2025): the expert's clone stays frozen and acts epsilon-greedily (EpsilonGreedyPresample) while a fresh critic trains, then the agent fine-tunes it. The update ratio and the critics stay the agent's own settings. The module's docstring lists where it departs from the paper. - Three more ways to use an expert or recorded data.
RLPDandRetainedDemonstrationskeep their rows in a ring of their own, which no later step evicts, andRLPDfills half of each batch from it.CHEQblends the agent's action with the expert's, by a weight that falls as the critics disagree. The update ratio and the critics stay the agent's own settings. Each one's docstring lists where it departs from its paper. - n-step returns on SAC.
n_stepsums that many rewards before the critics' target bootstraps, stopping at an episode's end. The return is uncorrected, as Rainbow's is, with no entropy bonus for the steps between. The first update waits for each env's replay to holdn_steprows. 1 is the default and changes nothing. - An offline phase on the agent's own observations.
ExpertPrefilltakesoffline_updates, asPriorDatadoes, so an agent reading observation features has offline updates on rows that hold them, which a dataset cannot. - A recording expert of its own.
ExpertPrefill,RetainedDemonstrationsandRLPDtakeexpert=. The agent'sexpert_policyis called on every step collected; this one on the recording's steps alone, so an arm with no expert online queries none. - IQL takes
normalize_rewards, as SAC does. Off by default. ajax.ledgerchargesJSRLCurriculum's gate andResidualPolicy(zero_start=True), whose pretraining costs no step, where it refused one and missed the other. A run with a gate can stop short of its budget by less than one evaluation, which no run length spends exactly, andassert_budgettakes that.- Representations during training.
RepresentationProbereads an agent's activations and parameters on a fixed set of states everyprobe_intervalsteps, writes them to a directory per seed, and logs each layer's effective rank, alignment with the previous probe, activation norm and dead units. Off unless listed. An architecture's activations are now layers without parameters, so flax'scapture_intermediatesreads a layer after its nonlinearity; saved parameters are unchanged. The agents on the on-policy family now bindenv_argsfor their extensions.python -m ajax.representation, with the newmanifoldsextra, embeds a run's activations (Aligned UMAP, M-PHATE) and weights (PCA beside a matched random walk) and plots its metrics.replay_states=also keeps observations of a training batch at each probe, on a replay agent. - On-policy agents train the steps they are asked for. PPO (with or
without memory), APO and PQN trained one rollout more than their budget
in every
traincall. They now train the whole rollouts the budget holds, at least one, as their original implementations do, and a run split into calls of whole rollouts ends where one call does. - APO evaluates at PPO's cost, as its official code does. Its reward
rate (
Eval/mean average reward) took 10,000 more steps per test episode, so each of APO's evaluations lasted up to ten times as long as PPO's. It now follows the official evaluation: 10 environments of 1,000 steps, stopped once 10 trajectories have ended, and the mean of their return / length. With the defaultnum_episode_test=10it shares the test episodes' run. - A simulator that diverges no longer ends a run. On a Brax or Playground
env, a step whose observation or reward is not finite now ends its episode
as a termination, with reward 0, and the run goes on. Before, one such step
made every network parameter NaN. This is a workaround: the physics behind
it, on Playground's humanoid tasks, is unchanged. Runs log the count as
Train/non-finite env steps, and the benchmark's records keep it per seed. Runs without such a step are unchanged, and checkpoints saved before this restore, their count at 0. - Playground tasks run on a GPU. They crashed there, because Ajax chose
pure-JAX physics on a CPU only and a GPU fell through to Playground's Warp
default. Pure JAX is now the default on every device, so a run's physics no
longer depends on the device;
build_env_from_id(..., physics="warp")selects Warp, which needs a GPU. - Reproduction protocol, version 2. A comparison whose score range says nothing about learning registers its own margin, with the reason. SAC and TD3 against Stable-Baselines3 on Pendulum (specs version 2) register ±14 and list what their matched arms still cannot match. PQN's specs (version 3) drop the optimiser from that list, since Ajax's PQN now uses purejaxql's.
- Expert guidance on Pendulum. A pre-registered comparison of
ExpertPrefill,JSRLCurriculum,IBRLandResidualPolicyagainst SAC alone, with a swing-up controller as the expert; the results are in the reproduction docs. - A benchmark of every agent (
benchmarks/suite/agent_suite.py): the continuous agents on MuJoCo Playground's CheetahRun, the discrete ones on Breakout-MinAtar, each at its defaults.timemeasures an agent's compile time, speed and memory;runtrains a range of seeds in chunks that resume where the last one stopped and commits a record after each. Its results cover ten agents on nineteen tasks. - The SAC family shares its update steps. REDQ, TQC, ASAC and RVI-SAC
share one actor step (
update_soft_actor), and the soft actor-critics keep their actor's and temperature's steps through one helper (keep_actor_then_update_temperature), both inajax.agents.temperature, sofixed_alphaworks one way in SAC, ASAC and RVI-SAC. REDQ and AVG use SAC's soft Bellman target, and IQL's update reads as its value, actor and critic steps. Results do not change. -
Known issue: the hopper and finger tasks with several seeds. An XLA bug stops Playground's
HopperHop,HopperStand,FingerSpin,FingerTurnEasyandFingerTurnHardfrom compiling when they are batched two ways, such as several seeds evaluated over several episodes. The environments guide gives the workaround, an XLA flag. -
train(devices=...)splits the seeds over several devices. Each device trains a consecutive slice of the seeds, or of a sweep's configurations over the seeds, at the same time; the results come back in the usual order on the first device. Withoutdevicesnothing changes. agent.save(state, path)andload.savewrites the state with the agent's class and its plain constructor arguments;ajax.load(path)orPPO.load(path)returns(agent, state). Arguments that are objects (a prebuilt environment, extensions, an expert policy) are passed toloadagain.save_checkpointandload_checkpointare unchanged, and read these files too.- Fixed: training held extra copies of its state. Each evaluation
between chunks of training returned a copy of the whole state, replay
included. A resumed run also kept the shorter replay it had grown out of
until the call ended. Evaluations now update the state in place, and a
resume frees the replay it replaces. No result changes. A state passed
as
initial_statewas already used up by the call; now its old replay is freed too. - Faster: training chunks compute only their last update's logs. A logged run computed the update logs (losses, gradient norms, the ensemble's spread) at every step and read them once per evaluation. Now only the step before an evaluation computes them. Measured on an RTX 2080 Ti at 10 seeds: SAC 4.9%, TD3 4.6%, TQC 3.9% less time per step; CrossQ and REDQ unchanged. Same steps in the same order; results move by floating-point rounding at most.
- Faster: CQL and Cal-QL score their sampled actions in one critic pass where there were four. Same values to rounding.
- New:
TDMPC2.preset("MuJoCo", env_id). The two settings the latest official TD-MPC2 code changes for its gym MuJoCo tasks:discount_max=0.99andrho=0.7. TD-MPC2's defaults are unchanged. - Changed default: a
traincall given nologging_configevaluates and prints. It evaluates about ten times over the call (every tenth of its steps, rounded up to whole iterations of the agent), prints a line for each (the mean return over the seeds, with the lowest and highest), and returns the evaluations where it returnedNone. Upgrade: passlogging_config=Nonefor the earlier behaviour: no evaluation, nothing printed,Nonereturned, and the fastest run. A call with aLoggingConfigis unchanged. - New: the evaluations by name.
train's second value is still the dict of logged names, and now also hasevaluations.returns(seeds x evaluations) andevaluations.timesteps. - New:
agent.evaluate(state, episodes=10, seed=0), the returns of fresh episodes of each seed's trained policy, one row per seed, acting asagent.policydoes; on a Gymnasium environment the episodes step in Python, one seed after another. The hook of that name on agents with their own loop (UDRL, APG, DreamerV3, TD-MPC2) is nowevaluation_metrics;TDMPC2MultiTask.evaluateis unchanged. - New:
LoggingConfig(on_evaluation=...), a function called in the training process with each seed's evaluation.
Upgrading from 0.5.0¶
The changes above that can break code or results each end with an "Upgrade:"
line saying what to do, most often the arguments that restore the earlier
behaviour: train without a logging_config (it now evaluates and prints),
PPO (value clip, TensorFlow 1's Adam, normalisation, one env and 64-64
layers, image PPO's shared encoder, recurrent PPO's heads), SAC's actor and
temperature start, DQN and its Atari preset, PQN, APO, APG's controller,
IQL's learning rate, REDQ's warm-up, DAgger's fit and beta_schedule,
normalize_rewards, the recurrent SAC family's networks and windows, Adam's
moments kept as one vector, the action range of mujoco:InvertedPendulum-v5
and mujoco:Pusher-v5, the mujoco: tasks' extra, the renamed
LoggingConfig(sweep=...) and ConditioningMetrics, act without a
reward, and the JAX floor. Checkpoints of recurrent SAC-family agents and of
DAgger saved before this version do not restore at the new defaults, and
image and recurrent PPO checkpoints restore with the arguments their Upgrade
lines give. The rest:
- An expert must keep its action's last axis, as the expert guide has
asked:
expert(obs)returns(..., action_dim), an index column(..., 1)on discrete actions. One that returned(...,)and ran by broadcasting is now refused; add[..., None]. - On-policy runs train one rollout fewer per
traincall, so their results move a little. A call asked for 8,192 steps of 1,024-step rollouts now stops at 8,192, not 9,216. What to do: compare with runs of this version. Code that took a second call's budget from the timestep reached can pass the run's remaining budget instead. JSRLCurriculumfollows its paper by default. It read a default of 1000 steps and fell with time. It now reads the horizon from the task and moves to the next stage when a moving average of the combined policy's evaluations comes within a tolerance of its best.schedule="random"is JSRL-Random. To keep the old form, passschedule="time":decay_fracalone now raises.eval_episodesnow defaults to 1, Ajax's value and not the paper's, since each evaluation spends steps on the plant. What to do: passeval_episodes=10for the old gate.ResidualPolicykeeps the expert during the warm-up. Its warm-up executed uniform actions without the expert; it now draws uniform residuals around it.zero_start=Truestarts the policy as the expert, andcritic_reads_residual=Truehas the critics read the residual, as both papers do. Runs with a residual policy and a warm-up change. What to do: compare with runs of this version.PriorData's offline updates train SAC's actor and temperature. They ran belowpolicy_update_startandalpha_update_start, so only the critics moved. Those starts still count the env steps collected online. Runs withPriorDatachange. What to do: compare with runs of this version.- IQL's state value reads normalised observations, as its actor and critics
do. Runs with
normalize_observations=Truechange. What to do: retrain; no option restores the raw read. - A replay row keeps the action executed. IQL's unsquashed samples left the action box, the env clipped them, and the replay kept the raw sample beside the reward of the clipped one. Rows now hold the clipped action, as IQL's reference does. Runs training IQL online change. On other replay agents only a row where an expert's action left the box changes.
- Cloning reads its inputs as the run does. It divided by another standard
deviation than the run on low-variance columns, and padded each epoch's last
batch with zero rows. Runs with
CloningPretrainchange, andreset_actor_head=Truenow reaches TD3's output layer. - An expert reads the run's params. It read the env's default params, so a sensor set through params reached the agent and not the expert. Evaluation and UDRL pass them too.
- The
planegroup takestarget-gym>=0.7,<0.9, from a commit until 0.8.0 is released. Build its experts withREGISTRY[name].make_pid_controller().batched(). - Fresh
playgroundinstalls build the Reacher tasks. MuJoCo Playground 0.2.0 compares versions as strings, soReacherEasyandReacherHardfailed onmujoco3.10 and later with'MjSpec' object has no attribute 'find_body'. Ajax now patches Playground's Reacher builder, and the extra takesmujoco3.6 to 3.15 (see "Theplaygroundextra allows MuJoCo up to 3.15" above). - APO's
Eval/mean average rewardchanges. It was the mean reward over 10,000 steps per test episode, the episodes restarting. It is now the official code's measure: the mean return / length of the first 10 trajectories to end on 10 environments of up to 1,000 steps, whatevernum_episode_testis. What to do: compare with runs of this version. - Fresh
playgroundinstalls import MuJoCo again. The extra now holdsmujoco-mjxtomujoco's range,>=3.6,<3.16.mujoco-mjx4.0 requiresmujoco-core, which MuJoCo 4 split out ofmujoco, so installers paired it withmujoco3.9 andimport mujocofailed withOSError: libmujoco.so.3.9.0: cannot open shared object file. The two ranges move together. log_frequency=1evaluates from the first step. With one env it skipped the evaluation at step 1, so the run came out one evaluation short and its last row stayed empty. Other settings evaluate as before.LoggingConfigevaluates every 10,000 steps by default, not every 1,000: 100 evaluations over a million steps. At 1,000, evaluation took about half the time of a 10-seed SAC run on MuJoCo Warp. What to do: passlog_frequency=1_000to keep the old rate.ajax.state.BaseAgentConfigandajax.agents.recurrent.RecurrentReplayConfigare removed. Nothing has read them since 0.4.0:expose_recent_rollout,burn_in,sequence_lengthandstored_stateare each agent's own fields. What to do: drop any import of them.ajax.state.with_batch_statsis nownetwork_variables. It returns the same variables, and also the encoder a network shares with another (share_encoder). What to do: rename the call; no result changes.- The SAC family's update functions.
critic_value_readersmoved fromajax.agents.criticstoajax.agents.update_steps, andcritic_stepbuilds it unless an agent passes its own. The SAC family's TD targets and SAC's soft policy loss take their key askey, notrng.SAC.compute_td_targetno longer takesrecurrent, norpre_trainbc_min_log_stdandbc_action_clip_eps, which no caller set (they are constants now). What to do: code calling these by keyword renames or drops the argument; no result changes.
0.5.0¶
What a user of 0.4.0 meets:
- Three new agents, CrossQ (Bhatt et al., ICLR 2024), TQC (Kuznetsov et al., ICML 2020) and RVI-SAC (Hisaki and Ono, ICML 2024), an average-reward SAC, each checked one training step at a time against its authors' code. Ajax has nineteen agents.
- Gymnasium environments, if you choose them (
"gymnasium:<id>", thegymnasiumextra): slower, as they step in Python, and a warning says so. - A trained agent acts and loads in one call:
agent.policy,agent.predictandload_checkpoint. - Logging goes through backends, TensorBoard by default.
- Each agent is one file on a shared family, and the expert tools (residual RL, gain mode, observation features, EDGE, IBRL, JSRL, the warm-up and the prefill) work on every agent they fit.
- Random numbers are stable: keys are derived by name, so an option or an extension leaves every other draw as it was, and resets are keyed by episode.
- Agents do what their authors' code does where they differed: ASAC, REDQ, AVG, PQN, APO, IQL, APG's schedule and IBRL.
- A replay reserves memory for the rows a run writes, and the replay and incremental agents' updates run faster on a CPU.
- The documentation site has a version per release.
Upgrading from 0.4.0¶
Each change below can break code or results that worked on 0.4.0, with what to do about it. The sections after it give the details.
- Every run draws other numbers from the same seed. Keys are derived
by name, collection and updates draw on two streams, resets are keyed by
episode and evaluations by phase and timestep; several agents now follow
their authors' code (next item); and the replay and incremental agents'
update runs under a jit of its own, which XLA rounds differently.
What to do: compare 0.5.0 results with 0.5.0 runs, not with 0.4.0's.
episode_keys=False(ajax.environments.create.build_env_from_id, orwith_episode_keys(env, on=False)) keeps 0.4.0's resets, but not its other draws. - Agents that now follow their authors' code, so their results move:
ASAC (a termination drops the next value), REDQ, AVG (its log-std head
read as a log-variance), PQN and APO (time limits), IQL (its two
critics' errors summed), APG (its learning-rate schedule steps the
matrices alone), IBRL (its target selects on a fresh critic subset),
EDGE (it scores the action executed). DQN draws its warm-up actions as
the other agents do; PPO, APO and IQL start a PID actor's log-std at -1,
as the others do; PPO, APO, PQN and AVG keep one set of observation
statistics, in the collector. A pretraining that runs the agent's updates
(
PriorData,BellmanPretrain) keeps the states those updates give the other extensions, where the next phase read their initial states. What to do: nothing; re-run results you compare against. - IBRL acts as its authors' code does by default
(
IBRL(hybrid_acting=True)): collection and evaluation execute the expert's action where the target critics rate it higher. What to do:IBRL(hybrid_acting=False)keeps 0.4.0's IBRL, which changed the target alone. - SAC with an expert no longer adds
ExpertWarmup(fraction=0.7)andExpertPrefill(n_steps=20_000)on its own. What to do: pass them inextensions=to keep them. - Runs log to TensorBoard by default, under
./tensorboard/<run id>/, where 0.4.0 logged to Weights & Biases.use_wandbanduse_tensorboardstill work, with a FutureWarning. What to do:LoggingConfig(backends=(WandbBackend(project, group),))for W&B (withpip install "ajax-rl[wandb]"),backends=()for no files. - Checkpoints are written in format 3. One saved before resets were
keyed by episode is refused by an agent whose environment keys them.
What to do: resume it with the environment built with
episode_keys=False.load_checkpoint(agent, path)restores a checkpoint without a 0-steptraincall. - Brax environments reset as Playground's do (
FreshAutoResetWrapper) when resets are keyed by episode, the default. What to do:episode_keys=Falsekeeps 0.4.0's stack. - Public names removed or moved. The 0.4.0 compatibility layer is gone
(Removed, below): each agent's
train_<A>,state,utilsandcoremodules, the<A>Configviews andagent.agent_config, SAC's deprecated keywords, and the old step and loss names. Besides: agent.dreamer_config, and TD-MPC2'sagent.agent_config, areagent.model_config;ajax.agents.DreamerV3andajax.agents.TDMPC2no longer re-exportDreamerV3Config,MODEL_SIZESandTDMPC2Config: import them fromajax.agents.DreamerV3.stateandajax.agents.TDMPC2.state;- the agents' target helpers (
compute_td_target,compute_td3_td_targetand the others), now in their agents' files, also return the value they bootstrapped: unpack one more value; PIDTermsWrapperis thePIDTermsInputextension;ActionPipelineResult.rngis gone;ajax.agents.stepsisajax.agents.update_steps; the ring rules moved fromajax.agents.DreamerV3.replaytoajax.buffers.ring;- a name an agent module only imported for its own use (
ActorCritic,EnvParams,CNNSpec,AlphaConfig,run_configand the like) no longer imports from that module: import it from its own module; - the helpers of SAC's removed observation keywords (
augment_obs,augment_from_batch,expert_state_dim,flatten_expert_stateandmaybe_append_train_fracinajax.evaluateandajax.environments.interaction,expert_next_actions) are gone:ExpertActionInput,ExpertStateInputandTrainingProgressInputdo their work. - Calls that ran on 0.4.0 and now raise, each naming what to pass:
EDGEExplorationunder gain mode (EDGE executes the expert's env action where the policy's gains go), refused when the agent is built;BellmanPretrainwithout a seeded replay (ExpertPrefillorPriorData), where it ran on an empty one;ConditioningMetricsandBiasVoreDecompositionon an agent that stores no steps (APG), where they logged nothing; IBRL's acting with an expert other than the agent's under a residual policy; a replay that has wrapped, resumed by an agent with a largerbuffer_size. - No dependency moved into an extra. A new one,
gymnasium, installs Gymnasium with MuJoCo for the opt-in Gymnasium environments. In a checkout,uv syncno longer installs wandb:uv sync --group wandbdoes. - The benchmark (
benchmarks/agent_bench.py) adds CrossQ, TQC, IQL and DAgger and records each row's device; the other agents' runs are unchanged, and its baseline is re-recorded with five trials.
New since 0.4.0, in brief¶
Not all of it has a section below:
- CrossQ and TQC: declared agents, with conformance checks against
their authors' code; critics may predict quantiles
(
NetworkConfig(critic_quantiles=N)). - RVI-SAC and the pieces it brings to the discounted agents:
ValueCentering(a target centred on a learned reward rate) andResetCost(terminations charged a learned cost); an extension'son_targetmay now learn from the target. - Gymnasium environments, opt-in, by id or as
GymnasiumEnv. - IBRL acts as its authors' code does (
hybrid_acting, on by default) and can choose softly (soft_choice=True,soft_choice_beta), as theiribrl_soft; its target selects on a fresh critic subset. - The expert tools reach every agent they fit: EDGE's gates every
continuous off-policy agent with an expert; residual RL and gain mode
every continuous agent with one; the observation features
(
ExpertActionInput,ExpertStateInput,TrainingProgressInput,PIDTermsInput) every agent on the shared collector. Evaluations log the replay's expert share (Eval/expert share). - Evaluation acts through the agent's controller, as collection does. Fixed: Brax and Playground evaluation now keeps the wrappers a user put over Ajax's environment; it ran without them.
- The update's own jit: the replay and incremental agents' update is compiled as a call of its own, which XLA's CPU pipeline runs about 8-10% faster (DQN, SAC, AVG; PERFORMANCE_REPORT.md), a deliberate workaround for its scheduling.
Changes in detail¶
- Gymnasium environments, if you choose them:
"gymnasium:HalfCheetah-v5"(orGymnasiumEnv(...)for an environment of your own) trains any agent on a Gymnasium environment, MuJoCo's tasks included. It steps in Python, outside the compiled program, so it is slower and its seeds train one after another; a warning says so and names the closest JAX tasks, with what differs. The newgymnasiumextra installs MuJoCo for it. Nothing changes for JAX environments. - RVI-SAC. A new average-reward agent,
RVISAC(Hisaki and Ono, ICML 2024): SAC learned by RVI Q-learning, its targetr - c 1(terminated) - xi + V'(s')going on through terminations,xifollowing the batch mean of the next values, and a reset costclearned as a Lagrange multiplier on the termination rate. Its defaults, initialisation, update order and evaluation action are the authors' (yhisaki/average-reward-drl); one update matches theirs leaf by leaf (tests/conformance/test_rvisac_original.py). - ValueCentering and ResetCost. Two extensions bring RVI-SAC's pieces
to the discounted agents.
ValueCentering(rule)centres a one-step target on a learned reward rate (Naik et al., RLC 2024) by one of three rules inajax.agents.centering:RVIBatchMean,TDErrorCentering,ReferencePoint.ResetCost()has the target go on through terminations and charges them a learned cost (ajax.agents.reset_cost). RVI-SAC calls the same functions. - What
on_targetmay learn from. An extension'son_targetmay now return(target, metrics, ext_state)to update its own state, and its batch holdsnext_values(the value the target bootstrapped),terminated,predictions()andtarget_value_at(obs, actions).update_steps.critic_stepreturns the agent state (its critics stepped, the extensions' states updated) in place of the critic state, andExtensionStack.apply_on_targetreturns the states as a third value. The agents' target helpers (compute_td_target,compute_td3_td_target,compute_redq_td_target,compute_tqc_td_target,compute_asac_td_target,compute_avg_td_target, IQL'scompute_bellman_target, DQN's two) also return the value they bootstrapped. DQN'std_target_fnmay return(target, next_actions, next_values); one returning the target alone still works. Two new capabilities:one_step_targetandcontinuing_target. AnExtension.check_stack(stack)hook refuses a stack that cannot hold an extension. The outputs of every existing agent and extension are unchanged. - Pretraining keeps the states its updates move. A pretraining that runs the agent's updates (PriorData, BellmanPretrain) now keeps the states those updates gave the other extensions, and a later pretraining reads the states the earlier ones left, where it read their initial ones.
NetworkConfig.squash_sigma_point_mean. A squashed policy's deterministic action can be the mean oftanhat the latent mean plus and minus its standard deviation (RVI-SAC's authors' evaluation action), in place oftanhof the mean.- A replay reserves memory for the rows its run writes. The replay
agents' replays (SAC, TD3, REDQ, ASAC, TQC, CrossQ, IQL, DQN, DAgger,
their recurrent forms too) held
buffer_size // n_envsrows per env however short the run: 38 MB per seed on Pendulum. A run now holds the rows it writes, those written before training (ExpertPrefill, PriorData, an offline dataset) included, plus one, at mostbuffer_size // n_envsper env; a resumed run grows the replay to the uninterrupted run's, as the world models' do. The numbers are unchanged: the runs replay the same rows. A checkpoint saved before restores and resumes as it did. A replay that has wrapped and is resumed by an agent with a largerbuffer_sizenow raises, namingbuffer_size, as DreamerV3's does; it kept its smaller ring silently. The ring rules moved fromajax.agents.DreamerV3.replaytoajax.buffers.ring:count_ring_rowsas it was,size_ringnow returning the ring length alone (each replay grows its own state). - Logging backends.
LoggingConfig(backends=(...))names where every run logs its evaluations:TensorBoardBackend(folder),WandbBackend(project, group), or a backend of your own, any picklable object withopen(run),log(run_id, step, metrics)andclose()(LoggingBackend; an optionalstart(run)runs in the caller before training). One backend object serves every seed's run.ajax.loggingnow exportsLoggingConfig,LoggingBackend,RunInfo,TensorBoardBackendandWandbBackend;ajax.logging.wandb_loggingstill works.backends=()logs nowhere; train still returns the evaluations. Nothing default changes: withoutbackends,use_wandb(on by default) anduse_tensorboarddecide as before. Setting either flag together withbackendsis refused.configdefaults to an empty dict.WandbBackend(steps=False)creates each run and sends it no evaluation, whichuse_wandbwithsweep=Truenames, as before. - The documentation site has a version per release. It opens on the latest release's documentation; each release keeps its own as X.Y, and main's is the development version, dev, marked as such. A release's pages link to its source at its tag. The Release workflow deploys a release's version (mike).
- A trained agent acts and loads in one call.
agent.policy(state, seed_index)returns a policy:carry = policy.reset(n_envs), thenaction, carry = policy.act(obs, carry, done, reward)acts on the environment's own observations, in its units, exactly as the agent's evaluation acts (the observation normalised as the agent does, its features, a residual policy or gain mode, a recurrent actor's memory, UDRL's command, a world model's state).agent.predict(state, observation)returns one action for an agent without memory.load_checkpoint(agent, path, **train_options)restores a saved state into an agent built with the same arguments, its skeleton built with the run's train options where they shape the update (APG's schedule). TDMPC2MultiTask has no policy yet. Training and evaluation are unchanged: their programs are the same. - A gymnax step no longer warns that float64 is unavailable: its terminated and truncated flags convert to float32 directly. Every number is unchanged.
- ConditioningMetrics and BiasVoreDecomposition log on PPO, APO, PQN
and AVG without
expose_recent_rollout. An extension declaringreads_last_rollouthas an on-policy or incremental agent keep its latest rollout; before, these logged nothing. They now requirestored_steps(a replay or such a rollout), which APG lacks.expose_recent_rolloutstill works. Runs that logged these metrics are unchanged. - An extension passed bare (
extensions=X) is refused with a TypeError that shows the tuple to write,extensions=(X(...),), instead of saying only that it is not iterable. - Documentation: the agent and extension totals match the code
(thirty-two extensions;
PIDTermsInputjoins the catalogue), the memory table lists every agent, and Why Ajax adds TorchRL and Tianshou, drops TQC and CrossQ from what Ajax lacks and installs from PyPI. A fast test checks the totals and lists against the code. - Documentation examples run in the tests, as the README's do: each
page's Python blocks in order, the pages that train in the slow tier.
Two examples did not run and are fixed: Environments used an undefined
environment, and Comparing agents'
estimatetrained 100,000 steps, which ends inside a PPO rollout and leaves the last evaluation NaN. - Documentation site: the world models' reference-comparison records (protocol, pre-registrations, diagnosis, results) leave the site and stay on GitHub, where the site's links to them now point; the design notes move under the Developer guide.
- The README says Ajax runs on a CPU or a GPU, and that its GPU speed is not yet measured, instead of putting every run on the GPU.
- Resets are keyed by episode (PEGASUS, Ng and Jordan 2000), on by
default: env i's k-th episode starts on a key of (i, k), and a gymnax
env's step t in it draws on a key of (i, k, t), so runs that differ by an
option, an extension or their updates start every episode alike. gymnax
envs get
EpisodeKeyedAutoResetWrapperunder their own wrappers, and brax stacks auto-reset as playground's (FreshAutoResetWrapper).episode_keys=False(build_env_from_id, orwith_episode_keys(env, on=False)) reproduces earlier runs. Checkpoints are format 3; one from before is refused with episode keys on. Every run draws other numbers. - An evaluation's keys follow its training phase and timestep
(
ajax.log.evaluation_keys), not its count: the log frequency no longer changes an evaluation's episodes, and the online evaluations aftertrain_offlineno longer replay the offline ones' keys. Every logged evaluation draws other episodes; training is unchanged. - No key is drawn twice. The observation noise (gymnax and brax), InitialStateWrapper's initial state and ModelReferenceWrapper's reference draw on keys derived by name from the key the inner env is handed whole, so wrapping an env leaves the env's own draws as they were. The expert's collection (ExpertPrefill, MCPretrain, CloningPretrain, recorded datasets) splits its carry first instead of carrying an env's step key on, and TD-MPC2's task embeddings no longer draw on the policy's initialisation key. Runs with these draw other numbers.
- Each extension draws on keys of its own, by name. In every phase an
extension's key is derived from its name and its occurrence among the
stack's extensions of that name (
ajax.extensions.base.extension_key_names), so adding, removing or moving another extension changes none of its keys. A pretrain or post_update running the agent's own steps (BellmanPretrain, PriorData, PhiRefresh, MCPretrain's rollout) draws on a key lent off the agent's, which then gets its own back. The action stage's extensions (EDGE's gates, IBRL's choice) and evaluation's choosers draw on keys derived from the step's instead of advancing the collection's or the evaluation's stream, and IBRL's subset and soft choice draw by name, so either option leaves the other's draw.ActionPipelineResult.rngis removed: a pipeline's key argument is the action stage's. Runs with extensions draw other numbers; runs without keep theirs. - Options and extensions no longer move the updates' keys. A key that exists only under an option, a count or an extension is derived by name or index instead of drawn from the stream: the extensions' post_update, an actor that steps on some updates only (policy_delay, policy_update_start), several critic or gradient steps per update (num_critic_updates, n_gradient_steps), PPO's and APO's minibatches, ExpertWarmup's decision and a recurrent network's initial carry. Runs that differ by one of them share every other draw, and SAC, REDQ, TQC, ASAC and AVG no longer draw a dropped actor step's keys again before policy_update_start. The agents using any of these draw other numbers.
- Updates and collection draw on two streams of keys. Collection draws
on its own key,
collector_state.rng, and the updates on the agent state's, each handing out its keys after its carry (ajax.random_keys): an update drawing more or fewer keys leaves the env steps, the action noise and the warm-up as they were, and a forced reset draws on a key derived from the collection's. Every agent but APG and the world models draws other numbers from the same seed. Checkpoints are written in format 2; an older one restores with the collection's key derived from the updates'. - DreamerV3 is a declared agent, read from
agents/DreamerV3/DreamerV3.pyon a new family,OwnReplayAgent(ajax.agents.families): each tick its row collector stores one row per env in a replay of its own, sized for eachtraincall (prepare_replay), and it runs the updates its schedule gives the absolute tick. Its keywords are fixed fields, keyword-only afterenv_id;gammais derived, no keyword.agent.dreamer_configis renamedagent.model_config. Deleted, without a deprecation path:train_DreamerV3,DreamerV3AgentConfigandagent.agent_config(its four fields are DreamerV3's) andagent.train_kwargs's entries. The names moved:TrainRatio,EnvSpec,env_spec(nowmeasure_env) andDreamerV3StatetoDreamerV3.py;policy_step(nowobserve_and_act),PolicyCarryandinitial_policy_carry(nowmake_initial_carry) toworld_model.py;train_metric_keys(nowlearner.list_train_metrics);bytes_per_row(nowreplay.count_row_bytes);MetricsAccumulatortoajax.log. Its extension context dropsagent_configandtotal_timesteps, which no extension read. Training is unchanged, bitwise. - TD-MPC2 is a declared agent on the own-replay family, read from
agents/TDMPC2/TDMPC2.py: its keywords are fixed fields, keyword-only afterenv_id. Thegammaandseed_stepsfields keep the values passed (None: derived from the episode length); the values used areagent.resolved_gammaandagent.resolved_seed_steps(readagent.gammafor the derived discount no more).agent.agent_configis renamedagent.model_config, onTDMPC2MultiTasktoo, andTDMPC2Configno longer subclassesBaseAgentConfig(itsexpose_recent_rolloutis gone). Deleted, without a deprecation path:train_TDMPC2andagent.train_kwargs's entries. The names moved:Schedule(nowFixedLengthSchedule),EpisodicScheduleandTDMPC2StatetoTDMPC2.py;planner_policy(nowplanner.plan_for_envs);update_metrics_zeros(nowcore.make_zero_update_metrics);clip_grad_norm,make_world_model_txandmake_policy_txfromcoretoTDMPC2/optim.py; the ring's creation tobuffer.make_episode_buffer.agents.TDMPC2no longer re-exports the classes (import them fromajaxor their modules). Its extensions are bound, to an empty context. Training is unchanged, bitwise. - UDRL runs the action stage.
JSRLCurriculumand EDGE's fixed gate hand its expert steps, and its segment keeps the choice executing the expert's action (the expert's own, or a residual of 0), which its actor fits;StorePolicyActionkeeps the policy's own instead. The gates draw on a fourth split of the step's key, taken only with an action extension. Runs without one are unchanged, bitwise. - UDRL observes the observation features.
ExpertActionInput,ExpertStateInput,TrainingProgressInputandPIDTermsInputjoin each observation of its segments, before the command, in collection and evaluation; UDRL's collector calls the expert through the shared wrapper (the expert first, gain mode last). Runs without features are unchanged, bitwise. - The world models observe the training progress and PID terms.
TrainingProgressInputandPIDTermsInputjoin each observation DreamerV3 and TD-MPC2 collect and evaluate: their encoders read them, and DreamerV3's decoder reconstructs them with the env's columns.TDMPC2MultiTask, which trains on logged observations, refuses them. Runs without features are unchanged, bitwise. - DQN and PQN take an expert.
expert_policy=(an index per row) andeval_expert_policy=: collection tracks the expert, evaluations log its return, andJSRLCurriculumand the expert's observation features run on both; DQN, which stores the expert's actions, also takesExpertPrefill,ExpertWarmupandExpertValueMetrics(Q at the stored index). PQN now fits Q at the actions its steps executed, the policy's own without an action extension. Runs without an expert are unchanged, bitwise. - IQL under a residual policy takes JSRL, EDGE and IBRL's acting. Where
one hands the agent's expert the step, IQL's replay keeps the residual
that executes the expert's action, 0, beside the executed action, which
its actor fits; IBRL acting with another expert is refused (a residual
need not reach that expert's action).
StorePolicyActionstill stores the policy's choice. The action pipelines' result carries the new columns (policy_action_for_expert,stored_policy_action). Runs that were accepted before are unchanged, bitwise. - APG logs its expert's return. Each evaluation also rolls out
eval_expert_policy, else the agent'sexpert_policy, alone on the same systems, and logsEval/episodic mean expert rewardandEval/expert bias(NaN without an expert), as every agent does; APG takeseval_expert_policy, which it refused before. Training is unchanged, bitwise; evaluations gain the two keys. - APG observes the observation features.
ExpertActionInput,ExpertStateInput,TrainingProgressInputandPIDTermsInputjoin the observation its controller reads in the differentiable rollout, their memory afresh at each episode start; the expert's features keep their gradient there (ObserveInputs.differentiable), as the expert a residual policy acts with does.closed_loop_rollouttakesobserveand itsRolloutkeepspolicy_observation. Runs without features are unchanged, bitwise. - DQN takes StorePolicyAction. Its replay, on the replay family's
collector, stores the policy's index where the run picks it; DAgger
refuses the ablation as missing a capability (
reward_learning: it learns from its expert's labels alone, no stored action). Runs without it are unchanged, bitwise. - Fixed: EDGE scores the executed action. Under
ResidualPolicy,EDGEExploration's scoring gates compared the expert's action with the policy's residual, while every critic is trained on the executed action (the residual through the expert). They now compare it with the action the step would execute, asIBRL's acting does. Runs with EDGE and a residual policy train differently; other EDGE runs do not change. - Gain mode refuses
EDGEExplorationwhen the agent is built, as it refusesJSRLCurriculumandValueBox: EDGE executes the expert's env action where the policy's gains go. It ran unnoticed when the expert had as many gains as the env has action dimensions, and failed when training started otherwise. - APG's schedule steps its matrices alone, as its reference does: with
lr_schedule="warmup_cosine"(contextual_controller's default) the biases, LayerNorm scales and PID gains keeplearning_rate. Scheduled APG runs train differently from before. The shared optimiser takes the option asOptimizerConfig.vector_learning_rate. - DQN, DAgger, UDRL and APG are declared agents, each read from
agents/<A>/<A>.py: keyword-only afterenv_id(DAgger'sexpert_policyincluded), fixed fields,<A>Configa view of them. DQN and DAgger are on the replay family, UDRL and APG on a new one,OwnIterationAgent(ajax.agents.families): the agent writes its iteration, report and evaluation, the loop resumes and logs; a train call's options (APG'sreset_optimizer_on_resume) go to itsconfigure_call, andtrain_offlinerefuses it. Their old modules are deleted, without a deprecation path (train_DQN,train_DAgger,train_UDRL,train_APG, each agent'sstate, UDRL'sutils): the 0.4.0 compatibility layer is removed in this release. Their names are in the agent files, some renamed: APG'smake_controller,make_agent_state,compute_rollout_returns(itskeyandn_systems),make_step_through_expert; UDRL'sscale_commandandcompute_actor_loss; DAgger'scompute_betaandchoose_learner_action; init, update and evaluation are methods. UDRL takescnn_extra_obs_dimandcnn_spec; DAgger and UDRL takeeval_expert_policy, which APG refuses (NotWired) until its evaluation rolls out an expert; APG refuses a badlr_schedulewhen it is built. Training is unchanged, bitwise, but for DAgger's replay, which now stores the expert's next action (next_a_expert, unread): its pipeline reads the expert's action collection computes, as every pipeline does. - UDRL logs its eval_expert_policy's return. UDRL takes
eval_expert_policy, as every agent with an expert does: each evaluation logs that expert's return on its episodes (Eval/episodic mean expert rewardandEval/expert bias), the expert taking no other part in the run. Runs without one are unchanged, bitwise. - The row collector and evaluate_policy observe features. With
observation features (
env_args.observers), the world models' row collector appends them to every row, fresh at each episode's start, andevaluate_policytakesagent_statefor the frozen training progress, asevaluatedoes. Runs without features are unchanged, bitwise. - Discrete experts outside DAgger. A discrete expert's action index, an
int
(n, 1)column, now steps the env in the expert's own rollouts (the replay prefill, the cloning and Monte-Carlo rollouts), entersExpertWarmup's mix as the policy's index, and entersExpertActionInputone-hot (ExpertInAgentUnits.action_count): PPO and APO run with one on CartPole. Continuous runs are unchanged, bitwise. - A skipped actor step logs the last one that ran. On the updates whose
actor step is skipped (TD3's and CrossQ's
policy_delay, any agent'spolicy_update_start), the actor's logged metrics are now those of its last real step, NaN before its first (update_steps.run_actor_if; the state keeps them inlast_actor_metrics). TD3 logged zeros there, CrossQ and IQL NaN, and SAC, TQC, REDQ, ASAC and AVG the metrics of the step they computed and dropped beforepolicy_update_start. Training is unchanged; only the logs move. A checkpoint saved without the field restores it as NaN.run_iflost itsfilloption, which TD3 alone used. - AVG is a declared agent,
agents/AVG/AVG.py, on a new family,IncrementalAgent(ajax.agents.families): one update on each step as it comes, no replay. Keyword-only afterenv_id, fixed fields,AVGConfiga view of them;train_AVG,AVG.stateandAVG.utilsare removed in this release, their names moved (value_loss_functionandpolicy_loss_functionarecompute_critic_lossandcompute_policy_loss;init_AVG,update_AVG_values(update_step_statistics),update_agent,update_value_functions,update_policyandmake_trainbecame methods). AVG claims the warm-up it always had before a positivelearning_starts, soExpertWarmupreaches it, and it takespolicy_update_startandeval_expert_policy. Training is unchanged, bitwise. - ASAC is a declared agent,
agents/ASAC/ASAC.py, as SAC is: keyword-only afterenv_id, fixed fields,ASACConfiga view of them;train_ASAC,ASAC.stateandASAC.utilsare removed in this release, their names moved (value_loss_functioniscompute_critic_loss;init_ASAC,update_agent,update_value_functions,update_policyandmake_trainbecame methods). ASAC now takespolicy_update_start,alpha_update_start,eval_expert_policyandStorePolicyAction, and a scheduledtarget_entropy_per_dim. A recurrent ASAC given extensions is refused by the family's check, as every recurrent agent is, with its message. Training is unchanged, bitwise. - REDQ is a declared agent,
agents/REDQ/REDQ.py, as SAC is: keyword-only afterenv_id, fixed fields,REDQConfiga view of them (no longer aSACConfigsubclass);train_REDQandREDQ.stateare removed in this release, their names moved (value_loss_functioniscompute_critic_loss;init_REDQ,update_agent,update_value_functions,update_policyandmake_trainbecame methods). REDQ now takespolicy_update_start,alpha_update_start,eval_expert_policy,BellmanPretrainandStorePolicyAction, andtarget_entropy_per_dimtakes a schedule besides a number and"mbpo". Training is unchanged, bitwise. - TQC is a declared agent,
agents/TQC/TQC.py, as SAC is: keyword-only afterenv_id, fixed fields,TQCConfiga view of them (no longer aSACConfigsubclass);train_TQCandTQC.stateare removed in this release, their names moved (init_TQC,update_agent,update_value_functions,update_policyandmake_trainbecame methods). TQC now takespolicy_update_start,alpha_update_start,eval_expert_policy,BellmanPretrainandStorePolicyAction, and a scheduledtarget_entropy_per_dim. Training is unchanged, bitwise. - SAC is a declared agent,
agents/SAC/SAC.pyon the replay family, as IQL, CrossQ and TD3 are. What changes for a caller: - the constructor is keyword-only after
env_id; its fields andagent_configare fixed once built;SACConfig, a view of the fields, is removed in this release; train_kwargsis empty: read the fields (agent.policy_update_start);expert_policyholds the expert as passed,agent.expertthe one in agent units;- SAC's equations are in
SAC.py, renamed by their verb:compute_soft_bellman_target,compute_soft_policy_loss,compute_soft_policy_objective,compute_temperature_loss,compute_alpha_temperature_loss(compute_td_targetandsample_next_actionskeep their names); the temperature is inajax.agents.temperature, the action pipeline inajax.agents.action_pipeline; - the old modules (
train_SAC,SAC.state,SAC.core,SAC.action_pipeline) are removed in this release, their names moved; the functions that became methods (init_SAC,update_agent,update_value_functions,update_policy,make_train) raise TypeError with the method's call form;SAC.corekeepsinit_soft_actor_critic,soft_actor_stepand the 0.4.0update_temperature; - the deprecated keywords are fields of
SACDeprecatedKeywords:store_policy_actionbuildsStorePolicyActionwhere it acted (with an expert, outside gain mode), andtarget_entropy_initial_per_dimwithtarget_entropy_ramp_fracbuilds the ramptarget_entropy_per_dimnow takes as a schedule; both warn.
Training is unchanged: every final state is bitwise the same, and so is
the training program's text.
- StorePolicyAction (ajax.extensions.expert), SAC's
store_policy_action as an extension for every replay agent on the
family: the replay stores the action the policy chose, not the one
executed. It acts in the controller alone, through a new controller
phase, choose_replay_action; TD3, CrossQ and IQL take it now, and the SAC family (SAC's store_policy_action keyword is removed in this release).
- A soft actor-critic's target entropy may be a schedule:
target_entropy_per_dim takes a function of the timestep
(ajax.schedule, as TD3's exploration_noise) on every agent with the
shared entropy temperature (EntropyTemperature): CrossQ now, the SAC
family as each is declared. SAC's target_entropy_initial_per_dim and target_entropy_ramp_frac are removed in this release: pass target_entropy_per_dim=linear(...).
- Every agent with an expert takes eval_expert_policy, SAC's option:
the expert whose return each evaluation logs, if not the training one
(ExpertGuided). Every agent on the shared loop reads
LoggingConfig.sweep, which only SAC read: a sweep evaluates only in the
last fifth of training. Runs without either are unchanged.
- BellmanPretrain runs on TD3, as on SAC: a replay agent with a
discounted Q critic and target critics gives it its critic step without
extensions (ReplayAgent.extension_values); REDQ and TQC take it once
declared. It now requires target critics, so CrossQ and DreamerV3 refuse
it for that reason, as they refused it before for another.
- Every replay actor-critic takes policy_update_start, SAC's knob:
TD3, CrossQ and IQL keep the actor's steps from that timestep on, and
CrossQ, as every soft actor-critic, takes alpha_update_start for its
temperature. Both default to 0, no wait: runs that leave them unset are
bitwise the same.
- IQL, CrossQ and TD3 are declared agents. Each is one file,
agents/<AGENT>/<AGENT>.py, on the replay family of the new
ajax.agents.families: its hyperparameters are dataclass fields, declared
once with the paper's defaults. What changes for a caller:
- the constructor is keyword-only after env_id;
- an agent's fields and agent_config are fixed once built
(dataclasses.replace(agent, gamma=0.9) builds another), and
agent_config is a view of the fields;
- TD3Config's learning_starts default (100) gives way to TD3's
(25 000), which TD3 always used;
- IQLConfig, CrossQConfig and TD3Config were views of the fields and are removed in this release;
- train_kwargs is empty: read the agent's fields and attributes
(agent.buffer, TD3's agent.pipeline, CrossQ's read-only
agent.alpha_args); make_train takes only the keywords every agent's
takes (no buffer, expert_policy or action_pipeline);
- expert_policy holds the expert as passed, which the run config logs;
agent.expert is the one read in agent units;
- the old modules (train_IQL, IQL.state, train_CrossQ,
CrossQ.state, train_TD3, TD3.state) are removed in this release, their names moved (train_TD3.update_target_networks is
TD3.update_targets). Their functions that became methods (the update
functions, init_<AGENT>, make_train) take other arguments: calling
one raises TypeError with the method's call form.
Training is unchanged: every final state is bitwise the same, and so is
the compiled program.
- PPO, APO and PQN are declared agents, on the on-policy family
(OnPolicyAgent in ajax.agents.families): each is one file,
agents/<AGENT>/<AGENT>.py. What changes for a caller, as for IQL,
CrossQ and TD3:
- the constructor is keyword-only after env_id;
- an agent's fields and agent_config are fixed once built, and
agent_config is a view of the fields;
- PPOConfig, APOConfig and PQNConfig were views of the fields and are removed in this release;
- train_kwargs is empty: PQN's epsilon_start, epsilon_end,
epsilon_decay_frac and td_loss_fn are its fields; make_train
takes only the keywords every agent's takes;
- PPO's and APO's expert_policy holds the expert as passed, which the
run config logs; agent.expert is the one read in agent units;
- PPO's encoder_kernel_init defaults to "orthogonal(np.sqrt(2))",
which None still means: PPO(encoder_kernel_init=None) trains as
before but logs None in the run config;
- the old modules (train_PPO, PPO.state, PPO.utils, PPO.core,
train_APO, APO.state, train_PQN, PQN.state, PQN.utils) are removed in this release, their names moved.
policy_loss_function and value_loss_function keep their
parameters. The functions that became methods (init_PPO,
init_APO, the update_agents, APO's update_networks, make_train)
take other arguments: calling one raises TypeError with the method's
call form.
Training is unchanged: every final state is bitwise the same, and so is
the compiled program.
- RolloutSplit. ajax.agents.minibatch.Geometry, how an on-policy
rollout is cut into minibatches, is now RolloutSplit, and
minibatch_geometry is choose_rollout_split: same arguments and fields,
kind still "flat", "time" or "recurrent". The split also says
where the advantages are computed (advantages_per_minibatch) and cuts
the rollout (minibatches). The old names are removed in this release.
- Extension phases are applied. ExtensionStack.fold_reward,
fold_on_target and fold_post_update are now apply_reward,
apply_on_target and apply_post_update, fold_init,
fold_init_states, fold_pretrain and fold_eval_metrics are
apply_init, apply_init_states, apply_pretrain and
apply_eval_metrics, and the two loss terms, fold_critic_loss and
fold_actor_loss, are computed: compute_extensions_critic_loss and
compute_extensions_actor_loss. So are ajax.agents.loop's
fold_on_target, fold_critic_loss and fold_post_update (also in
ajax.agents.update_steps): same arguments. The old names are removed in this release. TrainContext.stack is
TrainContext.extensions, and so is TrainLoop.stack.
- ajax.agents.minibatch.rollout_actions (ajax.agents.PPO.core's
before) is get_actions_and_log_probs; the old names are removed in this release.
- ajax.agents.SAC.SAC.augmentation_features is removed in this release, with SAC's deprecated keywords.
- ajax.agents.SAC.expert.collect_and_store_expert_transitions lives in
ajax.extensions.pretrain, for every replay agent, and writes its rows as
the live collector does (policy_action and next_action too); the old path is removed in this release.
- The extension phases' ExtensionContext parameter is named context
(was ctx). The stack passes it positionally, so an extension that
still names it ctx keeps working.
- Writing a name on a module it moved out of (monkeypatch.setattr on an
old path) raises AttributeError naming its new home, where it is read:
the write would have changed nothing.
- checkpoint.py reads PPO's and APO's restore rules off their state
classes (joint_gradient_clip, restore_hint); PPOState is a class of
its own, no longer an alias of BaseAgentState.
- BaseAgentState.get_keys_and_new_state(n=1) draws n keys from the
training key and returns them, then the new agent state:
shuffle_key, agent_state = agent_state.get_keys_and_new_state().
next_keys returns the same, the state first, until the agents still
calling it are converted.
- ajax.agents.update_steps.compute_gradients(loss, params) returns the gradients
of a loss of the parameters alone, and its aux; gradient_step and PPO's
and APO's minibatch steps take their gradients with it.
- update_steps.joint_step is now apply_gradients_clipped_together, which also
returns each network's gradient norm before the clip. joint_step is removed in this release.
- The declared agents (PPO, APO, PQN, TD3, IQL, CrossQ) and the shared
modules they use name their parameters and locals in full words: an
agent's state parameter is agent_state; the on-policy update's
start (and compute_values_from_rollout_sequence') is
agent_state_at_rollout_start; APO's minibatch_step takes
value_bias (was b); get_sequence_minibatches takes shuffle_key
(was rng); PPO's advantages method is compute_advantages. A caller
passing them by position, as the loop does, sees no change.
- The functions added since 0.4.0 that these modules define are named by
verbs: steps.when is run_if, steps.extension_key is
derive_extensions_key (its tag EXTENSIONS is EXTENSIONS_KEY_TAG),
TD3's and CrossQ's critic_update and actor_update are update_critic
and update_actor, IQL's equations start with compute_,
RolloutSplit.minibatches is cut_into_minibatches,
sequence_minibatches is get_sequence_minibatches, recurrent's
rollout_sequence_values is compute_values_from_rollout_sequence,
its actor_dist_train is ajax.networks.networks'
get_policy_updating_batch_statistics (beside
predict_value_updating_batch_statistics, was predict_value_train),
and PQN's epsilon_schedule method is make_epsilon_schedule.
- recurrent.py is split into labelled sections, and the machinery that
inserts the final observation of an episode a time limit cut is named
for it: stream_positions is row_positions_with_final_observations
(the old name is removed in this release), and RecurrentCarries.positions is
row_positions_with_final_observations.
- Verb names. ajax.agents.steps is ajax.agents.update_steps. A
function returning a loss or a target value starts with compute_, one
building a function or a network with make_: critics'
critic_loss_fn, q_regression_loss, q_loss_fn, mse_td_loss and
huber_1_td_loss are compute_mean_critic_loss,
compute_q_regression_loss, compute_q_loss, compute_mse_td_loss and
compute_huber_1_td_loss; IQL's expectile_loss is
compute_expectile_loss; PQN's half_mse_td_loss is
compute_half_mse_td_loss; TD3's critic_loss and policy_loss_function
are compute_critic_loss and compute_policy_loss, and
gaussian_exploration is make_gaussian_exploration; CrossQ's
batch_renorm_mlp is make_batch_renorm_mlp. The 0.4.0 paths
(train_DQN.huber_1_td_loss, train_DQN.mse_td_loss,
train_DQN.q_loss_fn, train_IQL.expectile_loss,
train_PQN.half_mse_td_loss, SAC.core.critic_loss_fn,
train_TD3.policy_loss_function) are removed in this release. A declared agent's hooks that build an object
start with make_: make_context(total_timesteps) (was context),
make_collector (was collector, also the TrainContext field),
make_replay_buffer (was replay_buffer) and
TrainContext.make_actor_critic (was actor_critic); behaviour is
choose_behaviour. The hooks that declare settings keep their names.
- PPO's memory handling lives in recurrent.py. PPO's losses are
compute_value_loss and compute_policy_loss: they take the minibatch
and no recurrent, resets or initial_hidden, and their keywords are
critic_state, normalize_advantage, entropy_key and
compute_extensions_loss (were critic_states,
advantage_normalization, entropy_rng and extra_loss_fn). The
networks run through ajax.agents.recurrent's get_policy_on_minibatch
and predict_values_on_minibatch, and the values GAE reads come from
compute_rollout_values; each serves a network with or without memory.
RolloutSplit.cut_into_minibatches and get_sequence_minibatches take
what a recurrent split's sequences replay from (the episode starts and
each network's memory at every sequence's start) as one dict. APO's
losses take the same names, with the keywords critic_state and
value_bias (was b). The 0.4.0 forms (train_PPO.value_loss_function and policy_loss_function, train_APO.value_loss_function and policy_loss_function) are removed in this release: call compute_value_loss and compute_policy_loss. PPO.py and
APO.py no longer define the old names. Training is unchanged: every
final state is bitwise the same, and so is the program.
- ASAC now does what the authors' code does (
darer/ASAC.py): a termination drops the next value in the critic's target (it bootstrapped through it); the termination penalty follows their rule,p_0times the larger reward of the batch's first two rows;thetaaverages the reward without the penalty, at the actions the actor step sampled, which the temperature step reads too; the entropy terms are measured fromlog(1/nA); and the policy's log-probability takes stable-baselines3's+1e-6in thetanhcorrection. Runs with terminations learn other values; continuing tasks change less. - REDQ now does what the authors' code does (
watchernyu/REDQ): its first update's critic targets and actor loss read the temperature 0.2, which the code's constructor leaves until its first temperature step, and the policy's log-probability takes the code's+1e-6in thetanhcorrection. Later updates readexp(log_alpha)as before. - AVG reads its log-std head as a log-variance, as the authors' code
does (
gauthamvasan/avg): the policy's standard deviation isexp(out / 2), its clip bounding the log-variance. Runs start with a different spread and learn otherwise. - PQN now does what purejaxql does: a time limit ends an episode in its returns (it bootstrapped there), epsilon is read once per update instead of at every step, and the rollout's second-to-last step reads the last step's bootstrap, as purejaxql's backward pass does. Its reproduction comparisons become version 2.
- APO ends an episode at a time limit, its next value dropped, and
leaves that step out of the loss, as xtma/apo does (
bootstrap_timelimit): it bootstrapped on the final observation and trained on the step. Withnormalize_advantage, the advantages use the other steps' mean and unbiased standard deviation, floored at1e-6. - IQL sums its two critics' squared errors, as the reference does
(
ikostrikov/implicit_q_learning,update_q): it averaged them, which halved the critics' gradient against Adam's eps andmax_grad_norm. ExpertWarmup(fraction)(ajax.extensions.expert): during the warm-up the agent's expert takes a share of the steps, uniform actions the others, through a new controller phase,choose_warmup_action(no state and no key in the learner). SAC, TD3, REDQ, ASAC, CrossQ and IQL (withlearning_startsabove 0) run it, under residual RL and gain mode too, where the expert's steps store the policy action that executes its own action. DQN (no expert yet) and TD-MPC2 (its own collector) refuse it as not wired yet; TQC and AVG, which have no uniform warm-up, refuse it, as does TD3 given its ownaction_pipeline. SAC'sexpert_fractionkeyword is removed in this release, and SAC with an expert no longer buildsExpertWarmup(fraction=0.7)on its own: pass the extension.ExpertPrefill(n_steps)(ajax.extensions.pretrain): the agent's expert actsn_stepssteps in every env before training and its transitions go to the replay as collection writes its own, on SAC, REDQ, ASAC, TQC, TD3, CrossQ and IQL. The rows count once in the observation and reward normalisers, asPriorData's do (one shared function,ajax.agents.loop.count_in_normalisers), and in no timestep. The pretraining now runs the replay's seeders (ExpertPrefill,PriorData) first, in stack order;train_offlinerefuses a prefill that would overwrite the dataset's rows. SAC'sexpert_buffer_n_stepskeyword is removed in this release, and SAC with an expert no longer buildsExpertPrefill(n_steps=20_000)on its own: pass the extension.- SAC's expert prefill runs in the pretraining, as
ExpertPrefill:init_SACand SAC'smake_trainlose it andexpert_buffer_n_steps. It is the same algorithm on other random numbers: the prefill draws the extension's key, and a run whose stack held no other learner extension now draws one more key per update. Under its old key the prefill's rows, statistics and timestep are bitwise the old ones. Undertrain_offlineits rows now come after the dataset's, and a prefill that would overwrite them is refused. Its rows now count in the observation and reward normalisers, which they skipped: a run combining the prefill with normalisation starts from other statistics. BellmanPretrainrequires a seeded replay (ExpertPrefillorPriorDatain the stack) instead of the agent's expert: with an expert andexpert_buffer_n_steps=0it ran on an empty replay, where it pre-trained on nothing, and now it is refused. BesidePriorDatait runs without an expert.- Fixed: gain mode's expert columns. Under
ExpertGainsthe replay'sa_expertandnext_a_experttook the width of the gains, while they hold the expert's env action: an expert with fewer gains than action dimensions crashed collection, and one with more had its action copied into every column. They now take the env's action width. Gain mode refuses an extension that uses an expert's actions where the policy's go (Extension.uses_expert_actions_as_policy_actions: ImitationLoss cloning its expert, OnlineBC, IBRL, LCBGatedBootstrap, CriticBlend, PhiRefresh, ExpertValueMetrics, CloningPretrain, MCPretrain): those are env actions, the policy's are gains. - Fixed: the expert prefill under an action transform. SAC's prefill
(
expert_buffer_n_steps, nowExpertPrefill) wrote the expert's env action into the action column, which gain mode keeps for the gains. A prefill row now stores what collection stores when the expert acts as itself, the policy action each transform names (policy_action_for_expert): the anchor gains (0) underExpertGains, and underResidualPolicya residual of 0 as the policy's action (IQL fits those) beside the expert's executed action. SAC runs in gain mode with a prefill learn other values. A prefill row ending in a termination keeps the reset observation as its next one, as collection does (ASAC's differential target continues from it); it kept the final one. NetworkConfig.squash_log_det_epssets the guard inside thetanhlog-det,log(1 - tanh(u)^2 + eps), for an agent whose reference uses one; 0, the exact log-det, by default.NetworkConfig.log_variance_headreads the log-std head as a log-variance, for the same reason.- Development: pull requests run the fast tier alone: the tests not marked slow, each under 128 gradient steps, and the conformance checks. The probes and every other training run in the slow tier, daily on main, on a labelled pull request and before a release.
Default changes¶
- Runs log to TensorBoard by default. A
LoggingConfigthat names no backends writes each run's TensorBoard events andconfig.jsonunder<folder>/tensorboard/<run id>/(the working directory by default), where it logged to Weights & Biases before. W&B needs thewandbextra and an account; name it withbackends=(WandbBackend(project, group),). use_wandbanduse_tensorboardare deprecated: set, they warn with a FutureWarning pointing tobackends, and log as before (W&B on unlessuse_wandb=False).uv syncno longer installs wandb in a checkout:uv sync --group wandbdoes.pip install ajax-rlnever did;ajax-rl[wandb]does.
Removed¶
- The 0.4.0 compatibility layer. A project pinned to 0.4.0 moves to the new forms when it upgrades:
- the modules that only served moved names: each agent's
train_<A>,state,utilsandcore, DQN's and TD3'snetworks, SAC'sexpertandaction_pipeline. Each name is inajax.agents.<A>.<A>or in the shared module it moved to;init_<A>,update_agentandmake_trainare the agent'sinit,updateand its family'smake_train. SAC'score.soft_actor_stepandinit_soft_actor_criticand the 0.4.0 loss forms (train_PPO.value_loss_function,policy_loss_function,train_APO.value_loss_function) have no replacement: callcompute_value_lossandcompute_policy_loss; - the former names
Geometry,minibatch_geometry,rollout_actions,stream_positions,joint_stepand thefold_<phase>aliases (nowRolloutSplit,choose_rollout_split,get_actions_and_log_probs,row_positions_with_final_observations,apply_gradients_clipped_togetherandapply_<phase>), and the step functionsajax.agents.loopre-exported (import them fromajax.agents.update_steps); - SAC's keywords
expert_buffer_n_steps,expert_fraction,use_pid_policy,use_train_frac,augment_obs_with_expert_action,augment_obs_with_expert_state,store_policy_action,normalize_obs_runningandtarget_entropy_initial_per_dimwithtarget_entropy_ramp_frac: passExpertPrefill,ExpertWarmup,ExpertGains,TrainingProgressInput,ExpertActionInput,ExpertStateInput.for_expert(expert),StorePolicyAction,normalize_observations=Trueandtarget_entropy_per_dim=linear(...).jsrl_curriculumandskip_critic_pretrainhad no effect. SAC with an expert no longer addsExpertWarmup(fraction=0.7)andExpertPrefill(n_steps=20_000)on its own: pass them to keep them; - each declared agent's
<A>Configview andagent.agent_config, and theagent_configargument of theirmake_train: read the agent's fields. DreamerV3 and TD-MPC2 keep their configs; - the six-argument action pipeline TD3 adapted (a pipeline takes the
step's
ActingStatesecond),LoggingConfig.horizon,PIDTermsWrapper(passPIDTermsInput) andajax.deprecation.
0.4.0¶
The first release since 0.3.1 (April 2025), which held SAC alone. Ajax has since been reworked; the documentation describes the result. What a user of 0.3.1 meets:
- Requirements: Python 3.12 or newer; JAX 0.10 and flax 0.12.8 or newer, with no upper bounds; gymnax 1.0.1 from PyPI instead of a fork. Ajax declares only the packages it imports, so gymnasium, mujoco, mujoco-mjx, pandas, matplotlib, pydantic and scipy are no longer installed with it. pip installs Ajax from PyPI or from its repository.
- Distribution name: Ajax is on PyPI as
ajax-rl(pip install ajax-rl); the import is unchanged,import ajax. A project that declaresajaxfrom git or a path renames itajax-rl. - Breaking: Brax and MuJoCo Playground are no longer installed with
Ajax. A project that uses their environments asks for
ajax-rl[playground](which brings Brax) orajax-rl[brax]; without them, building one of their environments raises an error that names the extra. - Extras:
ajax-rl[cuda](JAX with CUDA, Linux),ajax-rl[brax],ajax-rl[playground],ajax-rl[compare],ajax-rl[reproduction]andajax-rl[wandb]. - Agents: sixteen, each from a published paper: SAC, ASAC, REDQ, TD3, AVG, DQN, PQN, PPO, APO, UDRL, APG, DreamerV3, TDMPC2, TDMPC2MultiTask, IQL and DAgger, on one training loop, with several seeds in one compiled program. Each starts from its reference code's initialisation and optimiser settings where its algorithm page says so. TD3 makes the update of sfujim/TD3, its critics reading actions in the environment's units, as REDQ's do.
- Extensions: research features passed as
extensions=(...); an agent refuses, when built, one it cannot run. - Learning from data:
train_offline(dataset, n_updates)trains a replay agent (SAC, TD3, REDQ, ASAC, DQN, IQL) on a transition dataset before it acts, thentrainfine-tunes it online. On it run TD3+BC (ImitationLoss(None, target="replay", alpha=2.5), the paper's actor loss), ReBRAC (withTargetBC), CQL and Cal-QL (ConservativeQ,CalQL, for a policy with a density) and IQL. GAIL (AdversarialRewardon PPO) and DAgger imitate with no reward, and the expert-guidance extensions learn from an existing controller. - New modules:
ajax.compare(AdaStop and confidence sequences), transition datasets (ajax.buffers.dataset), checkpoints (ajax.checkpoint), recurrent memory, and the reference comparisons underbenchmarks/reference. - Development: dependency floors without caps, tested weekly at the
newest and the oldest versions allowed;
uv.lockrefreshed monthly. Conformance checks (tests/conformance) compare one update of an agent with its original implementation's: PQN, TD3, TD3+BC, REDQ and AVG so far. The tests come in two tiers (CONTRIBUTING.md, Testing): the slow tier, every test that trains, also runs daily on main, on a pull request labelledrun-slow-tierand before each release; tags come only from the Release workflow, once the slow tier passed on main's head.
Default changes¶
For projects that pin an Ajax commit: the merges since 2026-10-17 that move default runs. Each pull request says how.
| Agent | What changed | Pull requests |
|---|---|---|
| SAC, TD3, REDQ, ASAC, DQN, IQL, DAgger | the replay also draws each environment's newest row | #210 |
| SAC | Xavier-uniform layers, as softlearning; Adam eps 1e-8 | #193, #197 |
| ASAC | torch's layer init; temperature fixed at 0.2; learning rates 1e-4 and 5e-4, gradient clip 10; Adam eps 1e-8 | #193, #196, #197 |
| REDQ | Xavier-uniform layers; Adam eps 1e-8; critics read actions in the environment's units | #193, #197, #227 |
| TD3 | the 2019 code's settings (256-256, learning rate 3e-4, batch 256, 25,000 warm-up steps); torch's layer init; Adam eps 1e-8; summed critic losses, first actor step at the policy_delay-th update, critics in the environment's units |
#193, #196, #197, #220, #224 |
| TD3+BC, ReBRAC | ImitationLoss(alpha=...) is the paper's actor loss, λ times the agent's own plus the cloning term, actions compared in the environment's units |
#225 |
| AVG | orthogonal layers; Adam eps 1e-8 | #193, #197 |
| DQN | torch's layer init; centered RMSProp with a Huber loss, as Mnih et al. | #193, #197 |
| PQN | flax's lecun_normal layers; RAdam after a gradient clip of 10 |
#193, #197 |
| PPO | flat minibatches, GAE once per rollout; ppo2's orthogonal layers; Adam eps 1e-5, one gradient clip over both networks, vf_coef 0.5 |
#146, #159, #183 |
| PPO with memory | PureJaxRL's layer init; num_minibatches sets the sequence length |
#170, #188 |
| PPO, APO, UDRL, discrete actions | the logits head starts at orthogonal(0.01) | #147 |
| APO | its official code's actor head, 64-64 tanh layers, joint optimiser step and entropy bonus 0.01 | #192 |
| APG | Adam eps 1e-8; APG.contextual_controller does not clip its gradient |
#175 |
twin and ensemble critics, with max_grad_norm |
each critic clipped on its own | #196 |