Repository navigation
Tianshou 2.1.0 includes MuJoCo environment helpers in the Python package. You can now import make_mujoco_env from tianshou.env.mujoco without cloning the repository. Atari networks and wrappers are also available directly from tianshou.env.atari.
Highlights
- DQN and BDQN respect action masks in both standard and Double Q-learning targets. DQN applies replay importance weights to Huber loss, and BDQN uses the configured discount factor.
- C51 and Rainbow use the correct n-step successor. Continuous CQL samples actions uniformly and pools all action samples per state.
- Prioritized replay uses the transitions currently in the buffer to normalize weights. Vector buffers honor
weight_norm=Falseandset_beta(). Batch.stackkeeps empty rows aligned. Shared-memory vector environments preserve earlier observations across steps and resets.- Multi-agent training advances schedulers only for algorithms updated in the current batch, once per shared algorithm.
- Full policy checkpoints load again on PyTorch 2.6 and later. Only load pickled policies from trusted sources.
Upgrading from 2.0.x
- On-policy and off-policy wrappers, including ICM, now step each layer's learning-rate
schedulers once perupdate(). If you used the workaround in #1304,
removealgorithm.lr_schedulers.extend(algorithm.wrapped_algorithm.lr_schedulers)
to avoid stepping the wrapped algorithm's schedulers twice. VectorEnvNormObsnow acceptsclip_maxwith the same default of10.0asRunningMeanStd.
A value of0clips normalized observations to zero. If you used0to disable clipping,
setclip_max=Nonein your configuration and savedobs_rmsobjects.RunningMeanStdnow squares the initial standard deviation. If you supplied a variance
v, passstd=np.sqrt(v). The firstupdate()replaces the initial mean and variance.
Statistics saved after an update already contain a variance and need no conversion.- Discrete Q-learning algorithms and their high-level parameters now default to
target_update_freq=None. DQN variants,DiscreteCQLandDiscreteCRRresolve this to0.
DiscreteBCQuses the policy's interval, falling back to 8,000 gradient steps.
An explicit0disables the target network and now works forDiscreteBCQtoo.
See the release notes in the changelog or compare v2.0.1 with v2.1.0.