ray.rllib.algorithms.algorithm_config.AlgorithmConfig.validate_train_batch_size_vs_rollout_fragment_length#
- AlgorithmConfig.validate_train_batch_size_vs_rollout_fragment_length() None [source]#
Detects mismatches for
train_batch_size
vsrollout_fragment_length
.Only applicable for algorithms, whose train_batch_size should be directly dependent on rollout_fragment_length (synchronous sampling, on-policy PG algos).
If rollout_fragment_length != “auto”, makes sure that the product of
rollout_fragment_length
xnum_env_runners
xnum_envs_per_env_runner
roughly (10%) matches the providedtrain_batch_size
. Otherwise, errors with asking the user to set rollout_fragment_length toauto
or to a matching value.Also, only checks this if
train_batch_size
> 0 (DDPPO sets this to -1 to auto-calculate the actual batch size later).- Raises:
ValueError – If there is a mismatch between user provided
rollout_fragment_length
andtotal_train_batch_size
.