Skip to content

v2.1.0

Latest

Choose a tag to compare

@Trinkle23897 Trinkle23897 released this 04 Dec 04:48
45024c8

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=False and set_beta().
  • Batch.stack keeps 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 per update(). If you used the workaround in #1304,
    remove algorithm.lr_schedulers.extend(algorithm.wrapped_algorithm.lr_schedulers)
    to avoid stepping the wrapped algorithm's schedulers twice.
  • VectorEnvNormObs now accepts clip_max with the same default of 10.0 as RunningMeanStd.
    A value of 0 clips normalized observations to zero. If you used 0 to disable clipping,
    set clip_max=None in your configuration and saved obs_rms objects.
  • RunningMeanStd now squares the initial standard deviation. If you supplied a variance
    v, pass std=np.sqrt(v). The first update() 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, DiscreteCQL and DiscreteCRR resolve this to 0.
    DiscreteBCQ uses the policy's interval, falling back to 8,000 gradient steps.
    An explicit 0 disables the target network and now works for DiscreteBCQ too.

See the release notes in the changelog or compare v2.0.1 with v2.1.0.