init_noise_std silently ignored when distribution_type='tanh_normal' (default)
Summary
When using make_ppo_networks() with the default distribution_type='tanh_normal', the init_noise_std parameter is accepted without any warning but has no effect.
Root Cause
In make_policy_network() (networks.py:393-399), the tanh_normal branch creates a plain MLP:
if distribution_type == 'tanh_normal':
policy_module = MLP(
layer_sizes=list(hidden_layer_sizes) + [param_size],
activation=activation,
kernel_init=kernel_init,
layer_norm=layer_norm,
)
init_noise_std, noise_std_type, and state_dependent_std are all accepted by the function signature but never passed to this branch. The std is entirely determined by the network's output (second half of 2*action_size, passed through softplus in NormalTanhDistribution.create_dist()), with the initial value depending on random weight initialization.
Only the normal branch creates PolicyModuleWithStd, where init_noise_std actually initializes the learnable LogParam/Param.
Impact
- Users who set
init_noise_stdwhile using the defaulttanh_normalget zero feedback that the parameter is being ignored - Any hyperparameter sweep over
init_noise_stdundertanh_normalproduces identical results — wasted compute learner.pydefault flags combinetanh_normalwithinit_noise_std=1.0(dead code)train_test.pyteststanh_normal+init_noise_std=0.8without verifying it has any effect
We discovered this while training dexterous manipulation policies with MJX. We had been tuning init_noise_std under the default tanh_normal for some time before realizing it had zero effect.
Suggested Fix (any of)
- Raise a warning when
init_noise_stdis explicitly set withtanh_normal - Document that
init_noise_stdonly applies todistribution_type='normal' - Consider changing the PPO default to
distribution_type='normal'— most PPO implementations in the community (IsaacLab, rl_games, rsl_rl, CleanRL, Stable-Baselines3) use state-independent std without tanh squashing, consistent with Schulman's original PPO
I'd like to send a PR for this. Before writing it, a quick question on which option you'd prefer.
The least disruptive fix I can see is to raise a clear error when init_noise_std (or noise_std_type / state_dependent_std) is set together with distribution_type='tanh_normal', and to document that these options only apply to 'normal'. Default behavior and existing checkpoints stay exactly the same.
The alternative is to make tanh_normal honor init_noise_std by initializing the bias of the std output, but that changes the starting std for everyone using the default. I'd only do that if you want it.
I'm planning the first option unless you'd rather go another way.