rllib/agents/trainer_config.py
def rollouts(
        self,
        *,
        num_rollout_workers: Optional[int] = None,
        num_envs_per_worker: Optional[int] = None,
        create_env_on_local_worker: Optional[bool] = None,
        sample_collector: Optional[Type[SampleCollector]] = None,
        sample_async: Optional[bool] = None,
        rollout_fragment_length: Optional[int] = None,
        batch_mode: Optional[str] = None,
        remote_worker_envs: Optional[bool] = None,
        remote_env_batch_wait_ms: Optional[float] = None,
        ignore_worker_failures: Optional[bool] = None,
        recreate_failed_workers: Optional[bool] = None,
        horizon: Optional[int] = None,
        soft_horizon: Optional[bool] = None,
        no_done_at_end: Optional[bool] = None,
        preprocessor_pref: Optional[str] = None,
        observation_filter: Optional[str] = None,
        synchronize_filter: Optional[bool] = None,
        compress_observations: Optional[bool] = None,
    ) -> "TrainerConfig":
        """Sets the rollout worker configuration.

        Args:
            num_rollout_workers: Number of rollout worker actors to create for
                parallel sampling. Setting this to 0 will force rollouts to be done in
                the local worker (driver process or the Trainer actor when using Tune).
            num_envs_per_worker: Number of environments to evaluate vector-wise per
                worker. This enables model inference batching, which can improve
                performance for inference bottlenecked workloads.
            sample_collector: The SampleCollector class to be used to collect and
                retrieve environment-, model-, and sampler data. Override the
                SampleCollector base class to implement your own
                collection/buffering/retrieval logic.
            create_env_on_local_worker: When `num_workers` > 0, the driver
                (local_worker; worker-idx=0) does not need an environment. This is
                because it doesn't have to sample (done by remote_workers;
                worker_indices > 0) nor evaluate (done by evaluation workers;
                see below).
            sample_async: Use a background thread for sampling (slightly off-policy,
                usually not advisable to turn on unless your env specifically requires
                it).
            rollout_fragment_length: Divide episodes into fragments of this many steps
                each during rollouts. Sample batches of this size are collected from
                rollout workers and combined into a larger batch of `train_batch_size`
                for learning.
                For example, given rollout_fragment_length=100 and
                train_batch_size=1000:
                1. RLlib collects 10 fragments of 100 steps each from rollout workers.
                2. These fragments are concatenated and we perform an epoch of SGD.
                When using multiple envs per worker, the fragment size is multiplied by
                `num_envs_per_worker`. This is since we are collecting steps from
                multiple envs in parallel. For example, if num_envs_per_worker=5, then
                rollout workers will return experiences in chunks of 5*100 = 500 steps.
                The dataflow here can vary per algorithm. For example, PPO further
                divides the train batch into minibatches for multi-epoch SGD.
            batch_mode: How to build per-Sampler (RolloutWorker) batches, which are then
                usually concat'd to form the train batch. Note that "steps" below can
                mean different things (either env- or agent-steps) and depends on the
                `count_steps_by` (multiagent) setting below.
                "truncate_episodes": Each produced batch (when calling
                RolloutWorker.sample()) will contain exactly `rollout_fragment_length`
                steps. This mode guarantees evenly sized batches, but increases
                variance as the future return must now be estimated at truncation
                boundaries.
                "complete_episodes": Each unroll happens exactly over one episode, from
                beginning to end. Data collection will not stop unless the episode
                terminates or a configured horizon (hard or soft) is hit.
            remote_worker_envs: If using num_envs_per_worker > 1, whether to create
                those new envs in remote processes instead of in the same worker.
                This adds overheads, but can make sense if your envs can take much
                time to step / reset (e.g., for StarCraft). Use this cautiously;
                overheads are significant.
            remote_env_batch_wait_ms: Timeout that remote workers are waiting when
                polling environments. 0 (continue when at least one env is ready) is
                a reasonable default, but optimal value could be obtained by measuring
                your environment step / reset and model inference perf.
            ignore_worker_failures: Whether to attempt to continue training if a worker
                crashes. The number of currently healthy workers is reported as the
                "num_healthy_workers" metric.
            recreate_failed_workers: Whether - upon a worker failure - RLlib will try to
                recreate the lost worker as an identical copy of the failed one. The new
                worker will only differ from the failed one in its
                `self.recreated_worker=True` property value. It will have the same
                `worker_index` as the original one. If True, the
                `ignore_worker_failures` setting will be ignored.
            horizon: Number of steps after which the episode is forced to terminate.
                Defaults to `env.spec.max_episode_steps` (if present) for Gym envs.
            soft_horizon: Calculate rewards but don't reset the environment when the
                horizon is hit. This allows value estimation and RNN state to span
                across logical episodes denoted by horizon. This only has an effect
                if horizon != inf.
            no_done_at_end: Don't set 'done' at the end of the episode.
                In combination with `soft_horizon`, this works as follows:
                - no_done_at_end=False soft_horizon=False:
                Reset env and add `done=True` at end of each episode.
                - no_done_at_end=True soft_horizon=False:
                Reset env, but do NOT add `done=True` at end of the episode.
                - no_done_at_end=False soft_horizon=True:
                Do NOT reset env at horizon, but add `done=True` at the horizon
                (pretending the episode has terminated).
                - no_done_at_end=True soft_horizon=True:
                Do NOT reset env at horizon and do NOT add `done=True` at the horizon.
            preprocessor_pref: Whether to use "rllib" or "deepmind" preprocessors by
                default. Set to None for using no preprocessor. In this case, the
                model will have to handle possibly complex observations from the
                environment.
            observation_filter: Element-wise observation filter, either "NoFilter"
                or "MeanStdFilter".
            synchronize_filter: Whether to synchronize the statistics of remote filters.
            compress_observations: Whether to LZ4 compress individual observations
                in the SampleBatches collected during rollouts.

        Returns:
            This updated TrainerConfig object.
        """
        if num_rollout_workers is not None:
            self.num_workers = num_rollout_workers
        if num_envs_per_worker is not None:
            self.num_envs_per_worker = num_envs_per_worker
        if sample_collector is not None:
            self.sample_collector = sample_collector
        if create_env_on_local_worker is not None:
            self.create_env_on_local_worker = create_env_on_local_worker
        if sample_async is not None:
            self.sample_async = sample_async
        if rollout_fragment_length is not None:
            self.rollout_fragment_length = rollout_fragment_length
        if batch_mode is not None:
            self.batch_mode = batch_mode
        if remote_worker_envs is not None:
            self.remote_worker_envs = remote_worker_envs
        if remote_env_batch_wait_ms is not None:
            self.remote_env_batch_wait_ms = remote_env_batch_wait_ms
        if ignore_worker_failures is not None:
            self.ignore_worker_failures = ignore_worker_failures
        if recreate_failed_workers is not None:
            self.recreate_failed_workers = recreate_failed_workers
        if horizon is not None:
            self.horizon = horizon
        if soft_horizon is not None:
            self.soft_horizon = soft_horizon
        if no_done_at_end is not None:
            self.no_done_at_end = no_done_at_end
        if preprocessor_pref is not None:
            self.preprocessor_pref = preprocessor_pref
        if observation_filter is not None:
            self.observation_filter = observation_filter
        if synchronize_filter is not None:
            self.synchronize_filters = synchronize_filter
        if compress_observations is not None:
            self.compress_observations = compress_observations

        return self
Sets the rollout worker configuration.

        Args:
            num_rollout_workers: Number of rollout worker actors to create for
                parallel sampling. Setting this to 0 will force rollouts to be done in
                the local worker (driver process or the Trainer actor when using Tune).
            num_envs_per_worker: Number of environments to evaluate vector-wise per
                worker. This enables model inference batching, which can improve
                performance for inference bottlenecked workloads.
            sample_collector: The SampleCollector class to be used to collect and
                retrieve environment-, model-, and sampler data. Override the
                SampleCollector base class to implement your own
                collection/buffering/retrieval logic.
            create_env_on_local_worker: When `num_workers` > 0, the driver
                (local_worker; worker-idx=0) does not need an environment. This is
                because it doesn't have to sample (done by remote_workers;
                worker_indices > 0) nor evaluate (done by evaluation workers;
                see below).
            sample_async: Use a background thread for sampling (slightly off-policy,
                usually not advisable to turn on unless your env specifically requires
                it).
            rollout_fragment_length: Divide episodes into fragments of this many steps
                each during rollouts. Sample batches of this size are collected from
                rollout workers and combined into a larger batch of `train_batch_size`
                for learning.
                For example, given rollout_fragment_length=100 and
                train_batch_size=1000:
                1. RLlib collects 10 fragments of 100 steps each from rollout workers.
                2. These fragments are concatenated and we perform an epoch of SGD.
                When using multiple envs per worker, the fragment size is multiplied by
                `num_envs_per_worker`. This is since we are collecting steps from
                multiple envs in parallel. For example, if num_envs_per_worker=5, then
                rollout workers will return experiences in chunks of 5*100 = 500 steps.
                The dataflow here can vary per algorithm. For example, PPO further
                divides the train batch into minibatches for multi-epoch SGD.
            batch_mode: How to build per-Sampler (RolloutWorker) batches, which are then
                usually concat'd to form the train batch. Note that "steps" below can
                mean different things (either env- or agent-steps) and depends on the
                `count_steps_by` (multiagent) setting below.
                "truncate_episodes": Each produced batch (when calling
                RolloutWorker.sample()) will contain exactly `rollout_fragment_length`
                steps. This mode guarantees evenly sized batches, but increases
                variance as the future return must now be estimated at truncation
                boundaries.
                "complete_episodes": Each unroll happens exactly over one episode, from
                beginning to end. Data collection will not stop unless the episode
                terminates or a configured horizon (hard or soft) is hit.
            remote_worker_envs: If using num_envs_per_worker > 1, whether to create
                those new envs in remote processes instead of in the same worker.
                This adds overheads, but can make sense if your envs can take much
                time to step / reset (e.g., for StarCraft). Use this cautiously;
                overheads are significant.
            remote_env_batch_wait_ms: Timeout that remote workers are waiting when
                polling environments. 0 (continue when at least one env is ready) is
                a reasonable default, but optimal value could be obtained by measuring
                your environment step / reset and model inference perf.
            ignore_worker_failures: Whether to attempt to continue training if a worker
                crashes. The number of currently healthy workers is reported as the
                "num_healthy_workers" metric.
            recreate_failed_workers: Whether - upon a worker failure - RLlib will try to
                recreate the lost worker as an identical copy of the failed one. The new
                worker will only differ from the failed one in its
                `self.recreated_worker=True` property value. It will have the same
                `worker_index` as the original one. If True, the
                `ignore_worker_failures` setting will be ignored.
            horizon: Number of steps after which the episode is forced to terminate.
                Defaults to `env.spec.max_episode_steps` (if present) for Gym envs.
            soft_horizon: Calculate rewards but don't reset the environment when the
                horizon is hit. This allows value estimation and RNN state to span
                across logical episodes denoted by horizon. This only has an effect
                if horizon != inf.
            no_done_at_end: Don't set 'done' at the end of the episode.
                In combination with `soft_horizon`, this works as follows:
                - no_done_at_end=False soft_horizon=False:
                Reset env and add `done=True` at end of each episode.
                - no_done_at_end=True soft_horizon=False:
                Reset env, but do NOT add `done=True` at end of the episode.
                - no_done_at_end=False soft_horizon=True:
                Do NOT reset env at horizon, but add `done=True` at the horizon
                (pretending the episode has terminated).
                - no_done_at_end=True soft_horizon=True:
                Do NOT reset env at horizon and do NOT add `done=True` at the horizon.
            preprocessor_pref: Whether to use "rllib" or "deepmind" preprocessors by
                default. Set to None for using no preprocessor. In this case, the
                model will have to handle possibly complex observations from the
                environment.
            observation_filter: Element-wise observation filter, either "NoFilter"
                or "MeanStdFilter".
            synchronize_filter: Whether to synchronize the statistics of remote filters.
            compress_observations: Whether to LZ4 compress individual observations
                in the SampleBatches collected during rollouts.

        Returns:
            This updated TrainerConfig object.
        
Sets the rollout worker configuration.
Sets the rollout worker configuration .
def rollouts(
        self,
        *,
        num_rollout_workers: Optional[int] = None,
        num_envs_per_worker: Optional[int] = None,
        create_env_on_local_worker: Optional[bool] = None,
        sample_collector: Optional[Type[SampleCollector]] = None,
        sample_async: Optional[bool] = None,
        rollout_fragment_length: Optional[int] = None,
        batch_mode: Optional[str] = None,
        remote_worker_envs: Optional[bool] = None,
        remote_env_batch_wait_ms: Optional[float] = None,
        ignore_worker_failures: Optional[bool] = None,
        recreate_failed_workers: Optional[bool] = None,
        horizon: Optional[int] = None,
        soft_horizon: Optional[bool] = None,
        no_done_at_end: Optional[bool] = None,
        preprocessor_pref: Optional[str] = None,
        observation_filter: Optional[str] = None,
        synchronize_filter: Optional[bool] = None,
        compress_observations: Optional[bool] = None,
    ) -> "TrainerConfig":
        if num_rollout_workers is not None:
            self.num_workers = num_rollout_workers
        if num_envs_per_worker is not None:
            self.num_envs_per_worker = num_envs_per_worker
        if sample_collector is not None:
            self.sample_collector = sample_collector
        if create_env_on_local_worker is not None:
            self.create_env_on_local_worker = create_env_on_local_worker
        if sample_async is not None:
            self.sample_async = sample_async
        if rollout_fragment_length is not None:
            self.rollout_fragment_length = rollout_fragment_length
        if batch_mode is not None:
            self.batch_mode = batch_mode
        if remote_worker_envs is not None:
            self.remote_worker_envs = remote_worker_envs
        if remote_env_batch_wait_ms is not None:
            self.remote_env_batch_wait_ms = remote_env_batch_wait_ms
        if ignore_worker_failures is not None:
            self.ignore_worker_failures = ignore_worker_failures
        if recreate_failed_workers is not None:
            self.recreate_failed_workers = recreate_failed_workers
        if horizon is not None:
            self.horizon = horizon
        if soft_horizon is not None:
            self.soft_horizon = soft_horizon
        if no_done_at_end is not None:
            self.no_done_at_end = no_done_at_end
        if preprocessor_pref is not None:
            self.preprocessor_pref = preprocessor_pref
        if observation_filter is not None:
            self.observation_filter = observation_filter
        if synchronize_filter is not None:
            self.synchronize_filters = synchronize_filter
        if compress_observations is not None:
            self.compress_observations = compress_observations
        return self
def rollouts ( self , * , num_rollout_workers : Optional [ int ] = None , num_envs_per_worker : Optional [ int ] = None , create_env_on_local_worker : Optional [ bool ] = None , sample_collector : Optional [ Type [ SampleCollector ] ] = None , sample_async : Optional [ bool ] = None , rollout_fragment_length : Optional [ int ] = None , batch_mode : Optional [ str ] = None , remote_worker_envs : Optional [ bool ] = None , remote_env_batch_wait_ms : Optional [ float ] = None , ignore_worker_failures : Optional [ bool ] = None , recreate_failed_workers : Optional [ bool ] = None , horizon : Optional [ int ] = None , soft_horizon : Optional [ bool ] = None , no_done_at_end : Optional [ bool ] = None , preprocessor_pref : Optional [ str ] = None , observation_filter : Optional [ str ] = None , synchronize_filter : Optional [ bool ] = None , compress_observations : Optional [ bool ] = None , ) -> "TrainerConfig" : if num_rollout_workers is not None : self . num_workers = num_rollout_workers if num_envs_per_worker is not None : self . num_envs_per_worker = num_envs_per_worker if sample_collector is not None : self . sample_collector = sample_collector if create_env_on_local_worker is not None : self . create_env_on_local_worker = create_env_on_local_worker if sample_async is not None : self . sample_async = sample_async if rollout_fragment_length is not None : self . rollout_fragment_length = rollout_fragment_length if batch_mode is not None : self . batch_mode = batch_mode if remote_worker_envs is not None : self . remote_worker_envs = remote_worker_envs if remote_env_batch_wait_ms is not None : self . remote_env_batch_wait_ms = remote_env_batch_wait_ms if ignore_worker_failures is not None : self . ignore_worker_failures = ignore_worker_failures if recreate_failed_workers is not None : self . recreate_failed_workers = recreate_failed_workers if horizon is not None : self . horizon = horizon if soft_horizon is not None : self . soft_horizon = soft_horizon if no_done_at_end is not None : self . no_done_at_end = no_done_at_end if preprocessor_pref is not None : self . preprocessor_pref = preprocessor_pref if observation_filter is not None : self . observation_filter = observation_filter if synchronize_filter is not None : self . synchronize_filters = synchronize_filter if compress_observations is not None : self . compress_observations = compress_observations return self
Sets the rollout worker configuration.
Sets the rollout worker configuration .
"""Sets the rollout worker configuration.

        Args:
            num_rollout_workers: Number of rollout worker actors to create for
                parallel sampling. Setting this to 0 will force rollouts to be done in
                the local worker (driver process or the Trainer actor when using Tune).
            num_envs_per_worker: Number of environments to evaluate vector-wise per
                worker. This enables model inference batching, which can improve
                performance for inference bottlenecked workloads.
            sample_collector: The SampleCollector class to be used to collect and
                retrieve environment-, model-, and sampler data. Override the
                SampleCollector base class to implement your own
                collection/buffering/retrieval logic.
            create_env_on_local_worker: When `num_workers` > 0, the driver
                (local_worker; worker-idx=0) does not need an environment. This is
                because it doesn't have to sample (done by remote_workers;
                worker_indices > 0) nor evaluate (done by evaluation workers;
                see below).
            sample_async: Use a background thread for sampling (slightly off-policy,
                usually not advisable to turn on unless your env specifically requires
                it).
            rollout_fragment_length: Divide episodes into fragments of this many steps
                each during rollouts. Sample batches of this size are collected from
                rollout workers and combined into a larger batch of `train_batch_size`
                for learning.
                For example, given rollout_fragment_length=100 and
                train_batch_size=1000:
                1. RLlib collects 10 fragments of 100 steps each from rollout workers.
                2. These fragments are concatenated and we perform an epoch of SGD.
                When using multiple envs per worker, the fragment size is multiplied by
                `num_envs_per_worker`. This is since we are collecting steps from
                multiple envs in parallel. For example, if num_envs_per_worker=5, then
                rollout workers will return experiences in chunks of 5*100 = 500 steps.
                The dataflow here can vary per algorithm. For example, PPO further
                divides the train batch into minibatches for multi-epoch SGD.
            batch_mode: How to build per-Sampler (RolloutWorker) batches, which are then
                usually concat'd to form the train batch. Note that "steps" below can
                mean different things (either env- or agent-steps) and depends on the
                `count_steps_by` (multiagent) setting below.
                "truncate_episodes": Each produced batch (when calling
                RolloutWorker.sample()) will contain exactly `rollout_fragment_length`
                steps. This mode guarantees evenly sized batches, but increases
                variance as the future return must now be estimated at truncation
                boundaries.
                "complete_episodes": Each unroll happens exactly over one episode, from
                beginning to end. Data collection will not stop unless the episode
                terminates or a configured horizon (hard or soft) is hit.
            remote_worker_envs: If using num_envs_per_worker > 1, whether to create
                those new envs in remote processes instead of in the same worker.
                This adds overheads, but can make sense if your envs can take much
                time to step / reset (e.g., for StarCraft). Use this cautiously;
                overheads are significant.
            remote_env_batch_wait_ms: Timeout that remote workers are waiting when
                polling environments. 0 (continue when at least one env is ready) is
                a reasonable default, but optimal value could be obtained by measuring
                your environment step / reset and model inference perf.
            ignore_worker_failures: Whether to attempt to continue training if a worker
                crashes. The number of currently healthy workers is reported as the
                "num_healthy_workers" metric.
            recreate_failed_workers: Whether - upon a worker failure - RLlib will try to
                recreate the lost worker as an identical copy of the failed one. The new
                worker will only differ from the failed one in its
                `self.recreated_worker=True` property value. It will have the same
                `worker_index` as the original one. If True, the
                `ignore_worker_failures` setting will be ignored.
            horizon: Number of steps after which the episode is forced to terminate.
                Defaults to `env.spec.max_episode_steps` (if present) for Gym envs.
            soft_horizon: Calculate rewards but don't reset the environment when the
                horizon is hit. This allows value estimation and RNN state to span
                across logical episodes denoted by horizon. This only has an effect
                if horizon != inf.
            no_done_at_end: Don't set 'done' at the end of the episode.
                In combination with `soft_horizon`, this works as follows:
                - no_done_at_end=False soft_horizon=False:
                Reset env and add `done=True` at end of each episode.
                - no_done_at_end=True soft_horizon=False:
                Reset env, but do NOT add `done=True` at end of the episode.
                - no_done_at_end=False soft_horizon=True:
                Do NOT reset env at horizon, but add `done=True` at the horizon
                (pretending the episode has terminated).
                - no_done_at_end=True soft_horizon=True:
                Do NOT reset env at horizon and do NOT add `done=True` at the horizon.
            preprocessor_pref: Whether to use "rllib" or "deepmind" preprocessors by
                default. Set to None for using no preprocessor. In this case, the
                model will have to handle possibly complex observations from the
                environment.
            observation_filter: Element-wise observation filter, either "NoFilter"
                or "MeanStdFilter".
            synchronize_filter: Whether to synchronize the statistics of remote filters.
            compress_observations: Whether to LZ4 compress individual observations
                in the SampleBatches collected during rollouts.

        Returns:
            This updated TrainerConfig object.
        """
This updated TrainerConfig object.
This updated TrainerConfig object .
self
num_rollout_workers
Optional[int]
Number of rollout worker actors to create for
parallel sampling. Setting this to 0 will force rollouts to be done in
the local worker (driver process or the Trainer actor when using Tune).
Number of rollout worker actors to create for parallel sampling . Setting this to 0 will force rollouts to be done in the local worker ( driver process or the Trainer actor when using Tune ) .
num_envs_per_worker
Optional[int]
Number of environments to evaluate vector-wise per
worker. This enables model inference batching, which can improve
performance for inference bottlenecked workloads.
Number of environments to evaluate vector - wise per worker . This enables model inference batching which can improve performance for inference bottlenecked workloads .
create_env_on_local_worker
Optional[bool]
When `num_workers` > 0, the driver
(local_worker; worker-idx=0) does not need an environment. This is
because it doesn't have to sample (done by remote_workers;
worker_indices > 0) nor evaluate (done by evaluation workers;
see below).
When ` num_workers ` > 0 the driver ( local_worker ; worker - idx = 0 ) does not need an environment . This is because it doesn ' t have to sample ( done by remote_workers ; worker_indices > 0 ) nor evaluate ( done by evaluation workers ; see below ) .
sample_collector
Optional[Type[SampleCollector]]
The SampleCollector class to be used to collect and
retrieve environment-, model-, and sampler data. Override the
SampleCollector base class to implement your own
collection/buffering/retrieval logic.
The SampleCollector class to be used to collect and retrieve environment - model - and sampler data . Override the SampleCollector base class to implement your own collection / buffering / retrieval logic .
sample_async
Optional[bool]
Use a background thread for sampling (slightly off-policy,
usually not advisable to turn on unless your env specifically requires
it).
Use a background thread for sampling ( slightly off - policy usually not advisable to turn on unless your env specifically requires it ) .
rollout_fragment_length
Optional[int]
Divide episodes into fragments of this many steps
each during rollouts. Sample batches of this size are collected from
rollout workers and combined into a larger batch of `train_batch_size`
for learning.
For example, given rollout_fragment_length=100 and
train_batch_size=1000:
1. RLlib collects 10 fragments of 100 steps each from rollout workers.
2. These fragments are concatenated and we perform an epoch of SGD.
When using multiple envs per worker, the fragment size is multiplied by
`num_envs_per_worker`. This is since we are collecting steps from
multiple envs in parallel. For example, if num_envs_per_worker=5, then
rollout workers will return experiences in chunks of 5*100 = 500 steps.
The dataflow here can vary per algorithm. For example, PPO further
divides the train batch into minibatches for multi-epoch SGD.
Divide episodes into fragments of this many steps each during rollouts . Sample batches of this size are collected from rollout workers and combined into a larger batch of ` train_batch_size ` for learning . For example given rollout_fragment_length = 100 and train_batch_size = 1000 : 1 . RLlib collects 10 fragments of 100 steps each from rollout workers . 2 . These fragments are concatenated and we perform an epoch of SGD . When using multiple envs per worker the fragment size is multiplied by ` num_envs_per_worker ` . This is since we are collecting steps from multiple envs in parallel . For example if num_envs_per_worker = 5 then rollout workers will return experiences in chunks of 5 * 100 = 500 steps . The dataflow here can vary per algorithm . For example PPO further divides the train batch into minibatches for multi - epoch SGD .
batch_mode
Optional[str]
None
remote_worker_envs
Optional[bool]
If using num_envs_per_worker > 1, whether to create
those new envs in remote processes instead of in the same worker.
This adds overheads, but can make sense if your envs can take much
time to step / reset . Use this cautiously;
overheads are significant.
If using num_envs_per_worker > 1 whether to create those new envs in remote processes instead of in the same worker . This adds overheads but can make sense if your envs can take much time to step / reset . Use this cautiously ; overheads are significant .
remote_env_batch_wait_ms
Optional[float]
Timeout that remote workers are waiting when
polling environments. 0 (continue when at least one env is ready) is
a reasonable default, but optimal value could be obtained by measuring
your environment step / reset and model inference perf.
Timeout that remote workers are waiting when polling environments . 0 ( continue when at least one env is ready ) is a reasonable default but optimal value could be obtained by measuring your environment step / reset and model inference perf .
ignore_worker_failures
Optional[bool]
Whether to attempt to continue training if a worker
crashes. The number of currently healthy workers is reported as the
"num_healthy_workers" metric.
Whether to attempt to continue training if a worker crashes . The number of currently healthy workers is reported as the " num_healthy_workers " metric .
recreate_failed_workers
Optional[bool]
upon a worker failure - RLlib will try to
recreate the lost worker as an identical copy of the failed one. The new
worker will only differ from the failed one in its
`self.recreated_worker=True` property value. It will have the same
`worker_index` as the original one. If True, the
`ignore_worker_failures` setting will be ignored.
upon a worker failure - RLlib will try to recreate the lost worker as an identical copy of the failed one . The new worker will only differ from the failed one in its ` self . recreated_worker = True ` property value . It will have the same ` worker_index ` as the original one . If True the ` ignore_worker_failures ` setting will be ignored .
horizon
Optional[int]
Number of steps after which the episode is forced to terminate.
Defaults to `env.spec.max_episode_steps` (if present) for Gym envs.
Number of steps after which the episode is forced to terminate . Defaults to ` env . spec . max_episode_steps ` ( if present ) for Gym envs .
soft_horizon
Optional[bool]
Calculate rewards but don't reset the environment when the
horizon is hit. This allows value estimation and RNN state to span
across logical episodes denoted by horizon. This only has an effect
if horizon != inf.
Calculate rewards but don ' t reset the environment when the horizon is hit . This allows value estimation and RNN state to span across logical episodes denoted by horizon . This only has an effect if horizon ! = inf .
no_done_at_end
Optional[bool]
Don't set 'done' at the end of the episode.
In combination with `soft_horizon`, this works as follows:
no_done_at_end=False soft_horizon=False:
Reset env and add `done=True` at end of each episode.
no_done_at_end=True soft_horizon=False:
Reset env, but do NOT add `done=True` at end of the episode.
no_done_at_end=False soft_horizon=True:
Do NOT reset env at horizon, but add `done=True` at the horizon
(pretending the episode has terminated).
no_done_at_end=True soft_horizon=True:
Do NOT reset env at horizon and do NOT add `done=True` at the horizon.
Don ' t set ' done ' at the end of the episode . In combination with ` soft_horizon ` this works as follows : no_done_at_end = False soft_horizon = False : Reset env and add ` done = True ` at end of each episode . no_done_at_end = True soft_horizon = False : Reset env but do NOT add ` done = True ` at end of the episode . no_done_at_end = False soft_horizon = True : Do NOT reset env at horizon but add ` done = True ` at the horizon ( pretending the episode has terminated ) . no_done_at_end = True soft_horizon = True : Do NOT reset env at horizon and do NOT add ` done = True ` at the horizon .
preprocessor_pref
Optional[str]
Whether to use "rllib" or "deepmind" preprocessors by
default. Set to None for using no preprocessor. In this case, the
model will have to handle possibly complex observations from the
environment.
Whether to use " rllib " or " deepmind " preprocessors by default . Set to None for using no preprocessor . In this case the model will have to handle possibly complex observations from the environment .
observation_filter
Optional[str]
Element-wise observation filter, either "NoFilter"
or "MeanStdFilter".
Element - wise observation filter either " NoFilter " or " MeanStdFilter " .
synchronize_filter
Optional[bool]
Whether to synchronize the statistics of remote filters.
Whether to synchronize the statistics of remote filters .
compress_observations
Optional[bool]
Whether to LZ4 compress individual observations
in the SampleBatches collected during rollouts.
Whether to LZ4 compress individual observations in the SampleBatches collected during rollouts .